{"id":15821657,"url":"https://github.com/alan-agius4/speedy-json-extends","last_synced_at":"2025-05-08T07:35:25.516Z","repository":{"id":19380826,"uuid":"86920261","full_name":"alan-agius4/speedy-json-extends","owner":"alan-agius4","description":"Extend a JSON file with one or many existing files","archived":false,"fork":false,"pushed_at":"2024-07-28T13:31:41.000Z","size":31,"stargazers_count":3,"open_issues_count":11,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T19:51:03.823Z","etag":null,"topics":["extend","extendable","extends","json","json-files","node","nodejs","utility"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alan-agius4.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2017-04-01T14:50:04.000Z","updated_at":"2024-09-09T08:15:25.000Z","dependencies_parsed_at":"2024-10-05T07:40:39.786Z","dependency_job_id":null,"html_url":"https://github.com/alan-agius4/speedy-json-extends","commit_stats":{"total_commits":37,"total_committers":2,"mean_commits":18.5,"dds":"0.10810810810810811","last_synced_commit":"9d342d0e962ad887289dce5a1914523bccb365d6"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alan-agius4%2Fspeedy-json-extends","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alan-agius4%2Fspeedy-json-extends/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alan-agius4%2Fspeedy-json-extends/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alan-agius4%2Fspeedy-json-extends/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alan-agius4","download_url":"https://codeload.github.com/alan-agius4/speedy-json-extends/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253023503,"owners_count":21842251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["extend","extendable","extends","json","json-files","node","nodejs","utility"],"created_at":"2024-10-05T07:40:36.211Z","updated_at":"2025-05-08T07:35:25.498Z","avatar_url":"https://github.com/alan-agius4.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @speedy/json-extends\n[![CircleCI](https://circleci.com/gh/alan-agius4/speedy-json-extends.svg?style=shield)](https://circleci.com/gh/alan-agius4/speedy-json-extends)\n[![npm version](https://img.shields.io/npm/v/@speedy/json-extends.svg)](https://www.npmjs.com/package/@speedy/json-extends)\n[![Dependency Status](https://img.shields.io/david/alan-agius4/speedy-json-extends.svg?style=flat-square)](https://david-dm.org/alan-agius4/speedy-json-extends)\n[![devDependency Status](https://img.shields.io/david/dev/alan-agius4/speedy-json-extends.svg?style=flat-square)](https://david-dm.org/alan-agius4/speedy-json-extends?type=dev)\n\nExtend a JSON file with one or many existing files.\n\n### Installation\n\n```core\nnpm install @speedy/json-extends --save\n```\n\n\n### Usage\n#### json.read(filePath, [namedExtends]) ⇒ `Promise\u003cT\u003e`\nRetrieve a JSON file. Supports `extends` with one or many existing JSON files.\n\nExtends supports also Named Extends paths, as shown in the example.\n\n| Param        | Type                      | Required | Description                              |\n|--------------|---------------------------|----------|------------------------------------------|\n| filePath     | `string`                  | true     | path to a JSON file.                     |\n| namedExtends | `{[id: string]: string }` | false    | A key value pair of named extends paths  |\n\nTypeScript\n```ts\nimport { json } from \"@speedy/json-extends\";\n\nconst named = {\n  \"@speedy/commit-msg-hook:latest\": \"./node_modules/config/config.json\"\n};\n\njson.read(\"local-config.json\", named)\n  .then(content =\u003e {\n    // json content\n  });\n```\n\nJSON file\n```json\n{\n  \"extends\": [\n    \"@speedy/commit-msg-hook:latest\",\n    \"./local/config.json\"\n  ],\n  \"rules\": {\n    \"no-dash\": true\n  }\n}\n```\n\n#### json.readSync(filePath, [namedExtends]) ⇒ `T`\nSynchronous version of `json.read()`.\n\nTypeScript\n```ts\nimport { json } from \"@speedy/json-extends\";\n\nconst named = {\n  \"@speedy/commit-msg-hook:latest\": \"./node_modules/config/config.json\"\n};\n\nconst content = json.readSync(\"local-config.json\", named);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falan-agius4%2Fspeedy-json-extends","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falan-agius4%2Fspeedy-json-extends","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falan-agius4%2Fspeedy-json-extends/lists"}