{"id":22919960,"url":"https://github.com/xgqfrms/set-process-env","last_synced_at":"2026-04-12T10:43:42.095Z","repository":{"id":57356942,"uuid":"416970850","full_name":"xgqfrms/set-process-env","owner":"xgqfrms","description":"set-process-env by linux bash command without need  git ignore the .env file","archived":false,"fork":false,"pushed_at":"2022-04-24T09:48:29.000Z","size":58,"stargazers_count":1,"open_issues_count":11,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-19T19:04:25.321Z","etag":null,"topics":["bash","cross-env","env","linux","nodejs","npm","port-env","set-process-env","shelljs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/set-process-env","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xgqfrms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-14T03:03:28.000Z","updated_at":"2021-10-19T17:21:02.000Z","dependencies_parsed_at":"2022-09-12T18:51:18.920Z","dependency_job_id":null,"html_url":"https://github.com/xgqfrms/set-process-env","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xgqfrms/set-process-env","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xgqfrms%2Fset-process-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xgqfrms%2Fset-process-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xgqfrms%2Fset-process-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xgqfrms%2Fset-process-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xgqfrms","download_url":"https://codeload.github.com/xgqfrms/set-process-env/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xgqfrms%2Fset-process-env/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31712292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T06:22:27.080Z","status":"ssl_error","status_checked_at":"2026-04-12T06:21:52.710Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bash","cross-env","env","linux","nodejs","npm","port-env","set-process-env","shelljs"],"created_at":"2024-12-14T07:13:59.400Z","updated_at":"2026-04-12T10:43:42.074Z","avatar_url":"https://github.com/xgqfrms.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# set-process-env\n\n\u003e set-process-env by linux bash command without need git ignore the .env file\n\n[https://www.npmjs.com/package/set-process-env](https://www.npmjs.com/package/set-process-env)\n\n## install\n\n```sh\n$ yarn global add set-process-env\n# OR\n$ npm i -g set-process-env\n\n```\n\n## usage\n\n\n```sh\n# PORT_ENV for webpack \u0026 npm script dev\n$ spe PORT_ENV=8090\n\n```\n\n\u003e demo\n\n```js\n// package.json\n\n// ⚠️ precondition (cross-env@5.2.0, \u0026  npm scripts has dev command)\n// ⚠️ 前置条件 (cross-env@5.2.0 \u0026 npm scripts has dev command)\n\n{\n  // ...\n  \"scripts\": {\n    \"dev\": \"webpack-dev-server --inline\",\n    // \"dev\": \"cross-env NODE_OPTIONS='--max-old-space-size=8192' cross-env NODE_ENV=development webpack-dev-server --inline\",\n    // ...\n  },\n  // ...\n}\n\n```\n\n```js\n// webpack.config.js\nconst PORT = process.env.PORT_ENV || 8080;\n\nconsole.log('PORT_ENV =', process.env.PORT_ENV);\n// console.log('\\n process.env.PORT_ENV =', process.env.PORT_ENV);\n// console.log('\\n process.env.NODE_ENV =', process.env.NODE_ENV);\n// console.log('\\n process.env.NODE_OPTIONS =', process.env.NODE_OPTIONS);\n// console.log('\\n ✅ ');\n\n// const ip = require('ip');\n// const hostIp = ip.address();\nconst config = {\n  // ...\n  devServer: {\n    // ...\n    // host: hostIp,\n    port: PORT_ENV || 8080,\n    proxy: [\n      {\n        context: ['/web/api/'],\n        // dev\n        target: 'https://web-dev.xgqfrms.xyz',\n        // prod\n        // target: 'https://web-prod.xgqfrms.xyz',\n      },\n    ],\n  },\n};\n\nmodule.exports = config;\n\n```\n\n\n![image](https://user-images.githubusercontent.com/7291672/137370844-316bfd5e-fe0f-4e89-ab68-c937ee355a9b.png)\n\n\n\n## multi env \n\n```sh\n$ spe PORT_ENV=8090 PROXY_ENV=pre\n\n```\n\n![image](https://user-images.githubusercontent.com/7291672/137433698-23f62ecd-f59d-4f72-a3a6-14b1a27cfb12.png)\n\n![image](https://user-images.githubusercontent.com/7291672/137434750-e19f15bb-2b7b-4c19-9671-513b94b67563.png)\n\n## Travis CI\n\n\nhttps://travis-ci.org/xgqfrms/set-process-env/builds\n\nhttps://www.cnblogs.com/xgqfrms/p/12851281.html\n      \n## refs\n\nhttps://www.npmjs.com/package/app-node-env\n\n\n\n\u003c!-- \n\n\n$ spe PORT_ENV=8090\n\n$ spe PORT_ENV=8090 PROXY_ENV=pre\n\n --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxgqfrms%2Fset-process-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxgqfrms%2Fset-process-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxgqfrms%2Fset-process-env/lists"}