{"id":17963747,"url":"https://github.com/kamiazya/jsonnet-node-loader","last_synced_at":"2026-01-21T02:31:42.646Z","repository":{"id":44770613,"uuid":"421702751","full_name":"kamiazya/jsonnet-node-loader","owner":"kamiazya","description":"A loader that allows Node.js to import Jsonnet settings from an ES Module file.","archived":false,"fork":false,"pushed_at":"2023-10-20T07:15:18.000Z","size":334,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-16T12:24:55.466Z","etag":null,"topics":["jsonnet","node-loader","node-loader-hook"],"latest_commit_sha":null,"homepage":"https://kamiazya.github.io/jsonnet-node-loader/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kamiazya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"kamiazya","patreon":null,"open_collective":"kamiazya","ko_fi":"kamiazya","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-10-27T06:32:38.000Z","updated_at":"2021-11-03T05:59:35.000Z","dependencies_parsed_at":"2024-10-29T12:18:50.723Z","dependency_job_id":null,"html_url":"https://github.com/kamiazya/jsonnet-node-loader","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":"0.052631578947368474","last_synced_commit":"04488a575e3267aeed6bdec659c6a6f7942ec19b"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/kamiazya/jsonnet-node-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamiazya%2Fjsonnet-node-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamiazya%2Fjsonnet-node-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamiazya%2Fjsonnet-node-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamiazya%2Fjsonnet-node-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamiazya","download_url":"https://codeload.github.com/kamiazya/jsonnet-node-loader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamiazya%2Fjsonnet-node-loader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28623238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T23:49:58.628Z","status":"online","status_checked_at":"2026-01-21T02:00:08.227Z","response_time":86,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jsonnet","node-loader","node-loader-hook"],"created_at":"2024-10-29T11:45:01.981Z","updated_at":"2026-01-21T02:31:42.627Z","avatar_url":"https://github.com/kamiazya.png","language":"TypeScript","funding_links":["https://github.com/sponsors/kamiazya","https://opencollective.com/kamiazya","https://ko-fi.com/kamiazya"],"categories":[],"sub_categories":[],"readme":"[![NodeCI](https://github.com/kamiazya/jsonnet-node-loader/actions/workflows/node-ci.yaml/badge.svg)](https://github.com/kamiazya/jsonnet-node-loader/actions/workflows/node-ci.yaml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)\n[![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/kamiazya/jsonnet-node-loader)\n\n# jsonnet-node-loader\n\nA [loader](https://nodejs.org/api/esm.html#loaders) that allows Node.js to import [Jsonnet](https://jsonnet.org/) settings from an ESModule file.\n\n## Features\n\n- Support importing `.jsonnet` file\n\n## Installation\n\nIf you're using the npm or yarn CLI, then add the plugin by:\n\n\n[![NPM](https://nodei.co/npm/jsonnet-node-loader.png)](https://nodei.co/npm/jsonnet-node-loader/)\n\n\n```bash\n# yarn\n$ yarn add -D jsonnet-node-loader\n# or npm\n$ npm install --save-dev jsonnet-node-loader\n```\n\n## Usage\n\n### `loader` option\n\nSpecify jsonnet-node-loader in the loader option and execute the file.\n\nThen, when the jsonnet file is imported, the evaluated value is returned.\n\n```bash\n$ node --experimental-loader jsonnet-node-loader example.mjs\n{\n  person1: { name: 'Alice', welcome: 'Hello Alice!' },\n  person2: { name: 'Bob', welcome: 'Hello Bob!' }\n}\n```\n\n\u003cdetails open\u003e\n\u003csummary\u003eexample.mjs\u003c/summary\u003e\n\n```js\nimport data from './example.jsonnet';\n\nconsole.log(data);\n```\n\u003c/details\u003e\n\n\u003cdetails open\u003e\n\u003csummary\u003eexample.jsonnet\u003c/summary\u003e\n\n```jsonnet\n{\n  person1: {\n    name: \"Alice\",\n    welcome: \"Hello \" + self.name + \"!\",\n  },\n  person2: self.person1 { name: \"Bob\" },\n}\n```\n\u003c/details\u003e\n\n\n### Advanced usage\n\nWhen using `std.extVar(x)`, query parameters can be specified and passed when importing `vars.jsonnet`.\n\n\n\u003cdetails open\u003e\n\u003csummary\u003evars.jsonnet\u003c/summary\u003e\n\n```jsonnet\n{\n  vars: {\n    foo: std.extVar('foo'),\n    var: std.extVar('bar'),\n  },\n}\n```\n\u003c/details\u003e\n\n\u003cdetails open\u003e\n\u003csummary\u003evars.mjs\u003c/summary\u003e\n\n```js\nimport data from './vars.jsonnet?foo=1\u0026bar=2';\n\nconsole.log(data);\n// { vars: { foo: '1', var: '2' } }\n```\n\u003c/details\u003e\n\n\u003c/details\u003e\n\n## License\n\nThis software is released under the MIT License, see [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamiazya%2Fjsonnet-node-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamiazya%2Fjsonnet-node-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamiazya%2Fjsonnet-node-loader/lists"}