mstruebing
mstruebing

Reputation: 1812

babel-node param prefixed with "--" isn't passing

I have a npm start script "start": "babel-node index.js" If I want to pass arguments to it it is working if I not prefix the arguments with --.

I want to pass something like npm start --delete to delete the content of a database.

I try to get the arguments via process.argv.

npm start delete passes the argument but npm start --delte isn't.

Is there anything I have to do to get this working or it is even possible? Thanks in advance.

Upvotes: 0

Views: 795

Answers (1)

mstruebing
mstruebing

Reputation: 1812

To fix this I have to do: npm start -- --delete then the --delete is passed into my script. For this specific problem it isn't possible any other way at the moment when not touching the current toolchain.

Upvotes: 2

Related Questions