npm install handlebars-variables-extract
import extract from 'handlebars-variables-extract';
extract(`{{template}}`);
<script src="https://unpkg.com/handlebars-variables-extract@1.0.0/dist/handlebars-variables-extract.umd.js"></script>
input
<p>{{firstname}} {{lastname}}</p>
output like JSON schema https://json-schema.org/
{
"type": "object",
"properties": {
"firstname": {
"type": "any"
},
"lastname": {
"type": "any"
}
}
}
npm t
: Run test suitenpm start
: Runnpm run build
in watch modenpm run test:watch
: Run test suite in interactive watch modenpm run test:prod
: Run linting and generate coveragenpm run build
: Generate bundles and typings, create docsnpm run lint
: Lints codenpm run commit
: Commit using conventional commit style (husky will tell you to use it if you haven't 😉)
On library development, one might want to set some peer dependencies, and thus remove those from the final bundle. You can see in Rollup docs how to do that.
Good news: the setup is here for you, you must only include the dependency name in external
property within rollup.config.js
. For example, if you want to exclude lodash
, just write there external: ['lodash']
.
This project refer to barhandles.
Contributions of any kind are welcome!