Getting started
Less than 1 minute
Getting started
After installation using any convenient method described in Installation, you can start working with the server in the following way:
<script src="https://unpkg.com/hmpl-js@2.1.3/dist/hmpl.min.js"></script>
<script>
const templateFn = compile(
`{
{
"src":"/api/test"
}
}`
);
const elementObj = templateFn();
</script>
Or, if you need to work with hmpl as a module, there is a list of imported functions, such as compile
:
import { compile } from "hmpl-js";
const templateFn = compile(
`{
{
"src":"/api/test"
}
}`
);
const elementObj = templateFn();
These will be the two main ways to interact with the server. In future versions, the functionality will be expanded, but the methods themselves will not change.