{"id":15552213,"url":"https://github.com/bahmutov/with-package","last_synced_at":"2025-09-26T12:30:45.638Z","repository":{"id":33740779,"uuid":"37395451","full_name":"bahmutov/with-package","owner":"bahmutov","description":"Run any command with package.json properties exposed as environment variables","archived":false,"fork":false,"pushed_at":"2024-09-27T20:05:08.000Z","size":31,"stargazers_count":10,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-03T14:12:34.000Z","etag":null,"topics":["cli","npm","utility"],"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/bahmutov.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":"2015-06-14T02:04:53.000Z","updated_at":"2024-07-15T05:48:40.000Z","dependencies_parsed_at":"2023-12-12T05:23:29.683Z","dependency_job_id":"3551bcfd-2fad-4f02-94ab-86e2920593bd","html_url":"https://github.com/bahmutov/with-package","commit_stats":{"total_commits":75,"total_committers":3,"mean_commits":25.0,"dds":0.12,"last_synced_commit":"2e53d5d312604b3c3163117b6047ff4fee72fbd0"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fwith-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fwith-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fwith-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fwith-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bahmutov","download_url":"https://codeload.github.com/bahmutov/with-package/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234308784,"owners_count":18811930,"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":["cli","npm","utility"],"created_at":"2024-10-02T14:12:37.206Z","updated_at":"2025-09-26T12:30:45.319Z","avatar_url":"https://github.com/bahmutov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# with-package\n\n\u003e Run any command with package.json properties exposed as environment variables\n\n[![NPM][with-package-icon]][with-package-url]\n\n[![Build status][ci-image]][ci-url]\n[![semantic-release][semantic-image] ][semantic-url]\n[![renovate-app badge][renovate-badge]][renovate-app]\n\nImagine you want to use variables from the `package.json` in the script commands.\nNow you can. For example, let us say you want to commit and tag the git branch\nwith the current `version` label. Install `with-package` and use it as first keyword\nin the command\n\n    npm install --save-dev with-package\n\n```json\n\"scripts\": {\n  \"release\": \"with-package git commit -am pkg.version \u0026\u0026 with-package git tag pkg.version\"\n},\n```\n\nJust refer to any primitive property of `package.json` as `pkg.\u003cproperty name\u003e`. Objects and\narrays are not supported. If you need to debug the substitution, add `--debug` or `-d` flag\nto the command.\n\n    with-package echo this is pkg.description --debug\n\nNote: some of the `package.json` variables are already exposed as environment variables,\nsee [this doc](https://docs.npmjs.com/misc/scripts#package-json-vars).\n\n## Small print\n\nAuthor: Gleb Bahmutov \u0026copy; 2015\n[@bahmutov](https://twitter.com/bahmutov) [glebbahmutov.com](http://glebbahmutov.com)\n[glebbahmutov.com/blog](http://glebbahmutov.com/blog)\n\nLicense: MIT - do anything with the code, but don't blame me if it does not work.\n\nSpread the word: tweet, star on github, etc.\n\nSupport: if you find any problems with this module, email / tweet / open issue on Github\n\n[with-package-icon]: https://nodei.co/npm/with-package.svg?downloads=true\n[with-package-url]: https://npmjs.org/package/with-package\n[ci-image]: https://travis-ci.org/bahmutov/with-package.svg?branch=master\n[ci-url]: https://travis-ci.org/bahmutov/with-package\n[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n[semantic-url]: https://github.com/semantic-release/semantic-release\n[renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg\n[renovate-app]: https://renovateapp.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Fwith-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbahmutov%2Fwith-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Fwith-package/lists"}