npm-statement
v0.0.0
Published
a npm-scripts if/unless syntax using environment variable
Downloads
21
Maintainers
Readme
Npm Statement
Installation
npm install npm-statement --global
Usage
depending on the environment variable, can run the script.
export NODE_ENV=production
npm-if NODE_ENV is production then 'echo optimyze files...'
# optimyze files...
in addition can be run a local npm commands.
npm install eslint
npm-if NODE_ENV is production then 'eslint src' && echo pass
# pass
Syntaxes
npm-if VARIABLE trueScript
npm-if VARIABLE trueScript falseScript
npm-if VARIABLE then trueScript else falseScript
npm-if VARIABLE is {string|undefined} then trueScript else falseScript
npm-if VARIABLE is {string|undefined} then trueScript else falseScript
npm-if VARIABLE isnt {string|undefined} then trueScript else falseScript
npm-unless VARIABLE trueScript
npm-unless VARIABLE trueScript falseScript
npm-unless VARIABLE then trueScript else falseScript
npm-unless VARIABLE is {string|undefined} then trueScript else falseScript
npm-unless VARIABLE is {string|undefined} then trueScript else falseScript
npm-unless VARIABLE isnt {string|undefined} then trueScript else falseScript
Development
Requirement global
- NodeJS v5.10.0
- Npm v3.8.3
git clone https://github.com/59naga/npm-statement
cd npm-statement
npm install
npm test