{"id":22702554,"url":"https://github.com/vielhuber/from-env","last_synced_at":"2025-08-25T00:35:28.137Z","repository":{"id":47325828,"uuid":"166109431","full_name":"vielhuber/from-env","owner":"vielhuber","description":"🕶️ Get variables from env file in npm scripts. 🕶️","archived":false,"fork":false,"pushed_at":"2021-09-03T00:34:06.000Z","size":16,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T08:03:52.143Z","etag":null,"topics":["nodejs","npm","npm-scripts"],"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/vielhuber.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}},"created_at":"2019-01-16T20:46:21.000Z","updated_at":"2024-09-28T14:08:35.000Z","dependencies_parsed_at":"2022-09-19T05:10:34.507Z","dependency_job_id":null,"html_url":"https://github.com/vielhuber/from-env","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vielhuber%2Ffrom-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vielhuber%2Ffrom-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vielhuber%2Ffrom-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vielhuber%2Ffrom-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vielhuber","download_url":"https://codeload.github.com/vielhuber/from-env/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681491,"owners_count":21144700,"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":["nodejs","npm","npm-scripts"],"created_at":"2024-12-10T07:14:01.174Z","updated_at":"2025-04-13T08:04:41.519Z","avatar_url":"https://github.com/vielhuber.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🕶 from-env 🕶\n\nfrom-env is helper script that makes environment variables from a local ``.env``-file inside command line statements available.\n\n## installation\n\n```bash\nnpm install --save-dev from-env\n```\n\n## usage\n\n``.env``\n```.env\nVARIABLE1=needs\nVARIABLE2=have\nVARIABLE3=variables\n```\n\n```package.json``` (before)\n```json\n{\n    \"scripts\": {\n        \"yo\": \"your-command --that needs --to have --some variables\"\n    }\n}\n```\n\n```package.json``` (after)\n```json\n{\n    \"scripts\": {\n        \"yo\": \"from-env your-command --that %VARIABLE1 --to %VARIABLE2 --some %VARIABLE3\"\n    }\n}\n```\n\n### embedded variables replacement\n\nTo enable replacing variables that are not standlone:\n\n`from-env --embedded-vars your-command --things thing1=%VARIABLE1 thing2=%VARIABLE2 --other $VARIABLE3`\n\nor\n\n`from-env your-command --things thing1=%VARIABLE1 thing2=%VARIABLE2 --other $VARIABLE3`\n\nwith\n\n``.env``\n```.env\nFROM_ENV_EMBEDDED=true\n```\n\n## alternative\n\nthis also works without any package (also on windows with wsl):\n\n```package.json```\n```json\n{\n    \"scripts\": {\n        \"yo\": \"from-env your-command --that $(grep VARIABLE1 .env | cut -d '=' -f2) --to $(grep VARIABLE2 .env | cut -d '=' -f2) --some $(grep VARIABLE3 .env | cut -d '=' -f2)\"\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvielhuber%2Ffrom-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvielhuber%2Ffrom-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvielhuber%2Ffrom-env/lists"}