Skip to content
Search

Cross-env

lastmod 2023-03-07created 2023-03-072 edits

Run scripts that set and use environment variables across platforms

Caveats

WARNING

Make sure not to leave out the "-". Crossenv contains planted malware

Usage

npm install cross-env

Given the following package.json,

{
  "scripts": {
    "start": "NODE_ENV=production PORT=80 node server",
  },
}

Add cross-env in front of the environment settings in package.json:

{
  "scripts": {
    "start": "cross-env NODE_ENV=production PORT=80 node server", // cross-env 를 명시해준다
  },
}

Favorite site

author Zer0 sitemap