How do I pass command line arguments to a Node.js program?

I have a web server written in Node.js and I would like to launch with a specific folder. I’m not sure how to access arguments in JavaScript. I’m running node like this: $ node server.js folder here server.js is my server code. Node.js help says this is possible: $ node -h Usage: node [options] script.js … Read more

What’s the difference between tilde(~) and caret(^) in package.json?

After I upgraded to the latest stable node and npm, I tried npm install moment –save. It saves the entry in the package.json with the caret ^ prefix. Previously, it was a tilde ~ prefix. Why are these changes made in npm? What is the difference between tilde ~ and caret ^? What are the … Read more