Installation
To install the @ibnlanre/builder
package, you can use either npm (opens in a new tab), yarn (opens in a new tab) or pnpm (opens in a new tab). The following code snippets demonstrate how to install the package using either of the package managers:
npm install @ibnlanre/builder
CDN
The @ibnlanre/builder
package is also available on unpkg (opens in a new tab). You can include it in your HTML file using the following script tag:
<script src="https://unpkg.com/@ibnlanre/builder" type="module"></script>
Alternatively, you can use the importmap
attribute to import the package in your HTML file:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<script type="importmap">
{
"imports": {
"@ibnlanre/builder": "https://unpkg.com/@ibnlanre/builder"
}
}
</script>
<script type="module">
import { createBuilder } from '@ibnlanre/builder';
const register = {
foo: {
baz: (id) => `/bazaar/${id}`,
bar: 10,
},
};
const builder = createBuilder(register);
</script>
</head>
<body>
<div id="app"></div>
</body>
</html>