In your package.json
:
"scripts": {
"start": "per-env",
"start:development": "echo We're in development!",
"start:production": "echo We're in production!",
}
Then call npm start
. It'll read from NODE_ENV (defaulting to development) and run the appropriate script.
Inspired by https://github.com/ericclemmons/per-env.