Sorry for maybe a stupid question, a problem, but I do not understand)
Now I run the following script
node script.js I want to run just a command, enter the name of the program from anywhere, like
script and all)
How to implement it?
Sorry for maybe a stupid question, a problem, but I do not understand)
Now I run the following script
node script.js I want to run just a command, enter the name of the program from anywhere, like
script and all)
How to implement it?
I added to package.json
"preferGlobal": true, "bin": { "script": "script.js" }, To the top of the script.js file (entry point)
#!/usr/bin/env node Next, create a link using
npm link And after that we can run our script script just
script It is necessary to add the path in the PATH
Presumably you have Windows .
I have so:
Created .bat , which is executed with each start cmd :
HKEY_CURRENT_USER [SOFTWARE] [Microsoft] [Command Processor] (Autorun) = "%systemdrive%\path\to\file.bat" Creating links of the form:
doskey sudo = powershell %Tcmd%\ImplementationSudoCommand.ps1 $* Now in Windows there is a convenient way to run any program with elevated permissions: sudo cmd .
sudo in Windows. - KirbySource: https://ru.stackoverflow.com/questions/546746/
All Articles