Sunday, 11 June 2017

Install node package dynamically according to paramter

I need to update the node.js package.json dynamically for example if I run npm start with param A it will install

for example if I run npm start A it will start

{
  "name": "simplenodeapp",
  "main": "app.js",
  "scripts": {
    "start": "node  app.js" <some param",
  },
  "license": "ISC",
  "dependencies": {
    "express":"*"
  },

}

And if I run npm start B

{
  "name": "simplenodeapp",
  "main": "app.js",
  "scripts": {
    "start": "node  app.js" <some param>",
  },
  "license": "ISC",
  "dependencies": {
    "HAproxy":"*"
  },

}

is it possible ?



via Rayn D

No comments:

Post a Comment