How to properly run a npm script with arguments -
i've written small command line program nodejs , want able type npm run test
, run program arguments below.
typing following command directly works, node.exe scrappee.js -u 'https://github.com/matutter/{}' -us 'cloggie, airrocks-flightcontroller' -s '$commit=li.commits > > span, $sha=.right .commit-tease-sha' -pm .\test\example_parse_module.js
but contents of package.json follows there no output whatsoever.
"scripts": { "test" : "node.exe scrappee.js -u 'https://github.com/matutter/{}' -us 'cloggie, airrocks-flightcontroller' -s '$commit=li.commits > > span, $sha=.right .commit-tease-sha' -pm .\\test\\example_parse_module.js" }
how can command npm run test
run scrappee.js script these arguments?
the issue single quote '
being converted "'" npm when arguments forwarded, solution replace them double quotes below.
"test" : "node.exe scrappee.js -u \"https://github.com/matutter/{}\" -us \"cloggie, airrocks-flightcontroller\" -s \"$commit=li.commits > > span, $sha=.right .commit-tease-sha\" -pm \".\\test\\example_parse_module.js\""
Comments
Post a Comment