possibly stupid question #18
-
so how do you actually call the command from the commandline? nest BasicCommand |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Best answer is "it depends". If you're writing an npm package to be a script, you'll need to use the If you're making a script that will just be ran only in this repo/project, you can use Let me know if that helps or if I can clarify something more 😄 |
Beta Was this translation helpful? Give feedback.
Best answer is "it depends".
If you're writing an npm package to be a script, you'll need to use the
bin
property of thepackage.json
and point it to thedist/main
. Then when it is installed, the<feature>
will be a known shell command. This is how my @ogma/cli package works.If you're making a script that will just be ran only in this repo/project, you can use
ts-node
to run themain
fromsrc
if you don't want to compile, or you can compile and usenode dist/main
(or whatever the command file you have is). Then it's just passing the sub-command name (if no default) and the options and arguments.Let me know if that helps or if I can clarify something more 😄