{"id":15501862,"url":"https://github.com/gadicc/meteor-package-json","last_synced_at":"2025-07-28T18:13:10.674Z","repository":{"id":150149573,"uuid":"58854243","full_name":"gadicc/meteor-package-json","owner":"gadicc","description":"Package authors: fetch and watch changes in app's package.json","archived":false,"fork":false,"pushed_at":"2016-05-18T12:13:42.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T21:19:05.135Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/gadicc.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2016-05-15T09:43:07.000Z","updated_at":"2022-04-15T14:07:31.000Z","dependencies_parsed_at":"2023-06-11T03:23:52.406Z","dependency_job_id":null,"html_url":"https://github.com/gadicc/meteor-package-json","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"87dd19132a7f8eca1a5f96f52d9c7cc527a96a7a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gadicc%2Fmeteor-package-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gadicc%2Fmeteor-package-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gadicc%2Fmeteor-package-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gadicc%2Fmeteor-package-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gadicc","download_url":"https://codeload.github.com/gadicc/meteor-package-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247321064,"owners_count":20919908,"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":[],"created_at":"2024-10-02T09:06:08.515Z","updated_at":"2025-04-05T10:25:55.077Z","avatar_url":"https://github.com/gadicc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# meteor-package-json\n\nA helper for Meteor **build plugin** authors (for now) who need info from the apps `package.json`.  Watches the file and has a callback for your package to accept changes to it's relevant section, otherwise quits Meteor asking for the user to restart.\n\n## Quick Start\n\nFor the examples below, assume we are developing `john:doe` and have the following `package.json`:\n\n```js\n{\n  \"john:doe\": {\n    \"experimental\": false\n  }\n}\n```\n\n**Simple Fetch**\n\n```js\nconst config = packageJson.getPackageConfig('john:doe');\nexpect(config).to.deep.equal({ experimental: true });\n```\n\nIf the `john:doe` section is modified, Meteor will exit.  If any other part of the file is modified, nothing happens.  But it's even better if you can accept the changes to avoid a restart.\n\n**Accepting Changes**\n\n```js\n// The callback below is only ever called if prev does not deep equal next\nconst config = packageJson.getPackageConfig('john:doe', (prev, next) =\u003e {\n  if (prev.experimental !== next.experiemnetal) {\n    enableExperimentalFeatures(next.experimental);\n  }\n\n  // We can accept this change; no need to restart Meteor.\n  return true;\n});\n\n// On initial load\nif (config.experimental)\n  enableExperimentalFeatures(true);\n```\n\n## API\n\n* `packageJson.getPackageConfig('sectionName', [acceptHandler]);`\n\n  * Returns the `sectionName` property from `package.json`.\n  * If the properties in `sectionName` have *changed* (are not deeply equal), then, Meteor will quite if no `acceptHandler` is given, or if `acceptHandler(prevSection, newSection)` does not return `true`.\n  * For both the initial return and acceptHandler, if the section is undefined, an empty object (` {} `) will be returned, so no need to test for this in your   code.\n\n## Development \u0026\u0026 testing\n\n`npm test` or with Wallaby.js.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgadicc%2Fmeteor-package-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgadicc%2Fmeteor-package-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgadicc%2Fmeteor-package-json/lists"}