{"id":30181027,"url":"https://github.com/streamich/enwire","last_synced_at":"2025-08-12T08:07:10.803Z","repository":{"id":40410541,"uuid":"145555679","full_name":"streamich/enwire","owner":"streamich","description":"🐙 Rewire env vars","archived":false,"fork":false,"pushed_at":"2023-12-15T08:30:07.000Z","size":797,"stargazers_count":3,"open_issues_count":18,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-01T12:32:33.668Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/streamich.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}},"created_at":"2018-08-21T11:39:48.000Z","updated_at":"2018-10-20T10:38:01.000Z","dependencies_parsed_at":"2024-02-05T10:16:52.003Z","dependency_job_id":null,"html_url":"https://github.com/streamich/enwire","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/streamich/enwire","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fenwire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fenwire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fenwire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fenwire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/streamich","download_url":"https://codeload.github.com/streamich/enwire/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fenwire/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270024697,"owners_count":24514054,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-08-12T08:06:32.718Z","updated_at":"2025-08-12T08:07:10.776Z","avatar_url":"https://github.com/streamich.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![image](https://user-images.githubusercontent.com/9773803/47254584-cc0ca900-d464-11e8-888e-9b7bf07fbb7e.png)\n\n\n\n# enwire\n\nTool for *\"re-wiring\"* environment variables.\n\n- Supports `.json` format\n- Supports `.env` format\n\n\n## Installation\n\n```shell\nnpm install --global enwire\n```\n\nor use `enwire` without installation:\n\n```shell\nnpx enwire\nnpx enwire --no-process -r HOME\ncat package.json | npx enwire --pick name --no-process\ncat .env | npx enwire --pick foo --no-process\n```\n\n\n## *[`dotenv`](https://www.npmjs.com/package/dotenv)-like* Usage\n\nCreate a `.env` file with your env vars.\n\n```\nFOO=bar\n```\n\nRun your app with your env vars.\n\n```shell\ncat .env | enwire node app.js\n```\n\n\n## Usage\n\nPrint all env vars.\n\n```shell\nenwire\n```\n\nPrint selected env vars.\n\n```shell\nenwire --no-process --rewire HOME\n# {\"HOME\": \"...\"}\n```\n\nExport in env var format.\n\n```shell\nenwire --no-process --rewire HOME --format env\n# HOME=\"...\"\n```\n\nRewire env vars.\n\n```shell\nenwire --no-process --rewire HOME:TROLOLO\n# {\"TROLOLO\": \"...\"}\n```\n\nPass string as an env var.\n\n```shell\necho Hello | enwire --raw --no-process\n# {\"ENWIRE\": \"Hello\"}\n```\n\nSet custom name for string variable.\n\n```shell\necho Hello | enwire --raw --no-process --name HELLO\n# {\"HELLO\": \"Hello\"}\n```\n\nPopulate env vars from JSON.\n\n```shell\necho '{\"db\": \"Test\"}' | enwire --no-process\n# {\"db\": \"Test\"}\n```\n\nRewire JSON env vars.\n\n```shell\necho '{\"db\": \"Test\"}' | enwire --no-process --rewire db:PGDATABASE --delete db\n# {\"PGDATABASE\": \"Test\"}\n```\n\nPrint project name.\n\n```shell\ncat package.json | enwire --no-process --pick name\n# {\"name\": \"enwire\"}\n```\n\nRewire nested keys from JSON.\n\n```shell\ncat package.json | enwire --no-process --no-merge --rewire scripts.test:TEST_CMD\n# {\"TEST_CMD\": \"./test.sh\"}\n```\n\nPass project name to `printenv NAME` script.\n\n```shell\ncat package.json | enwire --rewire name:NAME -- printenv NAME\n# enwire\n```\n\nPass env vars to `yarn deploy` script.\n\n```shell\nenwire --rewire AWS_PROFILE_PROD:AWS_PROFILE -- yarn deploy\n```\n\nRewire environment variables.\n\n```shell\ndb=Test enwire --rewire db:PGDATABASE -- printenv PGDATABASE\n# Test\n```\n\nEvaluate arguments as JavaScript template strings.\n\n```shell\nHELLO=Hello enwire --eval -- echo \"\\${HELLO}, \\${USER + '\\!'}\"\n# Hello, user!\n```\n\nPrompt user to enter env var in console.\n\n```shell\nenwire --prompt TEST -- printenv TEST\n```\n\n\n## Options\n\n[`npx enwire --help`](https://github.com/streamich/enwire/wiki/enwire)\n\n\n- `--delete`, `-d` \u0026mdash; environment variable to delete.\n- `--eval`, `-e` \u0026mdash; evaluate CLI argumens as JS template strings.\n- `--import`, `-i` \u0026mdash; import and merge extra `.json` and `.env` files into process env\n- `--prompt`, `-p` \u0026mdash; prompt user to input variable in console if not set.\n- `--rewire`, `-r` \u0026mdash; from-to mapping of environment variable, e.g. `--rewire db:PGDATABASE`.\n- `--delete-rewired` \u0026mdash; if specified, rewired environment variables will be deleted.\n- `--format` \u0026mdash; by default exports in JSON format, `--format=env` can be set to export in env var format.\n- `--no-process` \u0026mdash; if specified, process environment variables will not be included.\n- `--no-stdin` \u0026mdash; don't merge STDIN into output.\n- `--pick` \u0026mdash; specifies which keys to pick from JSON object provided through STDIN.\n- `--help`, `-h` \u0026mdash; show usage info.\n- `--version`, `-v` \u0026mdash; show `enwire` version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamich%2Fenwire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstreamich%2Fenwire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamich%2Fenwire/lists"}