A loader that allows Node.js to import Jsonnet settings from an ES Module file.
A loader that allows Node.js to import Jsonnet settings from an ESModule file.
.jsonnet
fileIf you’re using the npm or yarn CLI, then add the plugin by:
# yarn
$ yarn add -D jsonnet-node-loader
# or npm
$ npm install --save-dev jsonnet-node-loader
loader
optionSpecify jsonnet-node-loader in the loader option and execute the file.
Then, when the jsonnet file is imported, the evaluated value is returned.
$ node --experimental-loader jsonnet-node-loader example.mjs
{
person1: { name: 'Alice', welcome: 'Hello Alice!' },
person2: { name: 'Bob', welcome: 'Hello Bob!' }
}
When using std.extVar(x)
, query parameters can be specified and passed when importing vars.jsonnet
.
</details>
This software is released under the MIT License, see LICENSE.