udarrr
udarrr

Reputation: 93

Argument with space throught command line node.js

I've done script like

"script:addsomething":"node ./myScript.js 'sometheng with space'"

If i am running it just like

node ./myScript.js 'sometheng with space' in powershell

it's work and I've got line in process.argv like 'sometheng with space'

But If i am running it like

npm run script:addsomething

i've got three line in process.argv How Can i solve it?

Upvotes: 0

Views: 1145

Answers (1)

Someone Special
Someone Special

Reputation: 13588

can you try

"script:addsomething":"node ./myScript.js \"sometheng with space\""

Upvotes: 1

Related Questions