{"id":13422032,"url":"https://github.com/kentcdodds/argv-set-env","last_synced_at":"2025-07-14T08:33:18.340Z","repository":{"id":57183633,"uuid":"44636934","full_name":"kentcdodds/argv-set-env","owner":"kentcdodds","description":"Set environment variables in npm scripts","archived":false,"fork":false,"pushed_at":"2021-01-25T23:22:41.000Z","size":5,"stargazers_count":51,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-20T02:24:05.327Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tonicdev.com/npm/argv-set-env","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/kentcdodds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.json","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-20T21:50:48.000Z","updated_at":"2024-10-26T07:12:22.000Z","dependencies_parsed_at":"2022-08-23T01:31:19.534Z","dependency_job_id":null,"html_url":"https://github.com/kentcdodds/argv-set-env","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kentcdodds/argv-set-env","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fargv-set-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fargv-set-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fargv-set-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fargv-set-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kentcdodds","download_url":"https://codeload.github.com/kentcdodds/argv-set-env/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcdodds%2Fargv-set-env/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265262712,"owners_count":23736455,"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-07-30T23:00:35.801Z","updated_at":"2025-07-14T08:33:18.305Z","avatar_url":"https://github.com/kentcdodds.png","language":"JavaScript","funding_links":[],"categories":["Packages"],"sub_categories":[],"readme":"You might actually want to look at my other utility [cross-env](http://npm.im/cross-env). It's probably what you're really looking for :-)\n\n# argv-set-env\n\nStatus:\n[![npm version](https://img.shields.io/npm/v/argv-set-env.svg?style=flat-square)](https://www.npmjs.org/package/argv-set-env)\n[![npm downloads](https://img.shields.io/npm/dm/argv-set-env.svg?style=flat-square)](http://npm-stat.com/charts.html?package=argv-set-env\u0026from=2015-09-01)\n[![Build Status](https://img.shields.io/travis/kentcdodds/argv-set-env.svg?style=flat-square)](https://travis-ci.org/kentcdodds/argv-set-env)\n[![Code Coverage](https://img.shields.io/codecov/c/github/kentcdodds/argv-set-env.svg?style=flat-square)](https://codecov.io/github/kentcdodds/argv-set-env)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)\n\nUse in your config files to set environment variables cross-platform.\n\n## Usage\n\nI use this with my npm scripts:\n\n```javascript\n{\n  \"scripts\": {\n    \"build\": \"webpack --set-env-NODE_ENV=production\",\n    \"test\": \"karma start --set-env-COVERAGE=true --set-env-NODE_ENV=test\"\n  }\n}\n```\n\nAnd then in my `webpack.config.js` file, at the very top I do:\n\n```javascript\nrequire('argv-set-env')()\n```\n\nWhich in the case of `build` would set `NODE_ENV` to the string `'production'` and in the case of\n`test` it would set `NODE_ENV` to the string `'test'` and `COVERAGE` to the boolean `true`.\n\n### Options\n\nYou can optionally pass `options`:\n\n```javascript\nrequire('argv-set-env')({\n  // I'm setting these to the defaults here\n  // you could set them to whatever you want\n  env: process.env, // the object to have variables set on\n  argv: process.argv, // the array of arguments which have the arguments defined\n  prefix: '--set-env', // the prefix used in the array of arguments defining variables to set\n})\n```\n\n## LICENSE\n\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentcdodds%2Fargv-set-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkentcdodds%2Fargv-set-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentcdodds%2Fargv-set-env/lists"}