Question: in script: we want to check env. variable {dev / test / mock} and execute the following script actions based on this.
if $ mock is true, run script start-mock else continue accessing the real test server
scenario 1: we added commands aggregated in the package.json script section
eg : "test": "export NODE_ENV=dev; grunt", [on linux] which is "test": "(SET NODE_ENV=dev) & (grunt)", [on win32]
scenario 2: there may be a bat / sh script sitting in a package, and we called them from package.json
Scenario 3: (permanent solution) not sure if it is already available there
sort of
get arguments from script section: to give flexibility and freedom to end user. eg : "test": "solution.env NODE_ENV=dev; solution grunt"
where we can have a script for processing (input from process.platform) out put depends on the OS.
"start-pm2": "if \"% MOCK% \ "== \" true \ "(npm run mock and pm2 start process.json --env test) else (pm2 start process.json)", [windows] for linux if .. fi 
source share