Answer the question
In order to leave comments, you need to log in
How to run a module with a command?
I wrote a module that creates a web server on a local PC but there is one inconvenience. When starting, I have to go to the module directory and write the following command: node index.js C:/Projects/the_site
that is, I have to specify the path to the site folder.
And the question is: how to run a module in a different directory with a command like:web-server ./
Answer the question
In order to leave comments, you need to log in
package.json
//....
"scripts": {
"dev": "node index.js"
// Или
"web-server": "node index.js"
}
//....
npm run dev
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question