Closed gabrielcsapo closed 7 years ago
@gabrielcsapo this is almost certainly not something that makes sense to have in npx itself.
If you want to replicate npm's CLI parsing, you can do it using two things: yargs
and npm-package-arg
. You use yargs to figure out the npm command (taking into account all the --flags
), and then use npm-package-arg
on the install targets, which will give you an object with all the information you're looking for here.
Would it be possible for
npx
to take annpm
command likeinstall tap-html@0.0.4
and be able to parse it into an AST into which people could abstract the desired behavior of that command?So
install tap-html@0.0.4
would turn into;needed for https://github.com/local-npm/local-npm/issues/154 🤕
Arguably the code could be as simple as
but just thought it would be something interesting to add to npx!