{"id":27083,"library":"json-bundler","title":"json-bundler","description":"json-bundler is a Node.js CLI tool for bundling multiple JSON and JSON5 files into a single merged JSON file. Version 1.0.0 is the initial release. It uses a $ref key to reference other JSON files, supports JSON5 for comments and linebreaks, and offers minification and watch mode. Features include merging with priority for the referencing file and support for referencing npm packages via ~. It is designed for tasks like i18n file organization in Angular or other web projects. Requires Node.js 7.6+.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/dominique-mueller/json-bundler","tags":["javascript","json","json5","bundle","merge","combine","18n","angular","typescript"],"install":[{"cmd":"npm install json-bundler","lang":"bash","label":"npm"},{"cmd":"yarn add json-bundler","lang":"bash","label":"yarn"},{"cmd":"pnpm add json-bundler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Parsing JSON5 files","package":"json5","optional":false},{"reason":"Watch mode file monitoring","package":"chokidar","optional":true}],"imports":[],"quickstart":{"code":"npm install json-bundler --save-dev\n\n# Create entry file: en.json\n{\n  \"greeting\": \"Hello\",\n  \"$ref\": \"./messages/welcome.json\"\n}\n\n# Referenced file: messages/welcome.json\n{\n  \"welcome\": \"Welcome to our app!\"\n}\n\n# Run bundler (outputs merged file)\nnpx json-bundler --entryFile en.json --outFile dist/en.json","lang":"javascript","description":"Install json-bundler, create entry and referenced JSON files, then bundle them into a single output file."},"warnings":[{"fix":"Use paths relative to the file's location.","message":"`$ref` paths are relative to the file containing the $ref, not the current working directory.","severity":"gotcha","affected_versions":"1.0.0"},{"fix":"Be aware of merge priority: referencing file overrides referenced files.","message":"When a referenced file contains keys that already exist in the referencing file, the referencing file's values take precedence.","severity":"gotcha","affected_versions":"1.0.0"},{"fix":"Use `~package-name/path/file.json` to reference npm packages.","message":"Paths starting with `~` are resolved in the project's `node_modules` folder, not user home directory.","severity":"gotcha","affected_versions":"1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure referenced file exists and the path in $ref is correct relative to the referencing file.","cause":"Referenced file path is incorrect or file missing.","error":"ENOENT: no such file or directory, open './nonexistent.json'"},{"fix":"Validate JSON5 syntax with a JSON5 parser or use valid JSON.","cause":"Referenced JSON5 file has syntax errors.","error":"Error: Invalid JSON5 file"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}