Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world....
This is the second article of the series “Learn JavaScript” aimed at helping you with your first steps in the JavaScript world.
Last time, you learned how to prepare your JavaScript workspace by installing Visual Studio Code and Node....
There are various approaches to learning JavaScript. One of the most common approaches is to start with HTML in a playground that runs in your browser.
The upside is that it’s very easy to get started, but the downside is that when you get to actually learning JavaScript you’ve lost your motivation, and you can’t move to the next level....
If you’re looking to find out what’s the latest version of a certain package, you can quickly check this information right in your terminal with the command npm view.
Here’s how you can check the latest version of express:...
In this short tutorial you’ll learn how to check the version of any installed npm package including the ones that have been installed globally using the -g flag.
Locally installed packages To check the current versions of the npm packages for your project, you should navigate to the project directory where your package....
It’s essential to keep all the node modules of your project up to date as the security patches go out.
In this short tutorial I’ll teach you how to update all the node_modules to the latest version with a single command....
The file package.json is an integral part of every Node.js project. It stores all the dependencies that your project needs.
All the dependencies (most often open-source npm modules) are split into two categories: production dependencies and development dependencies....
The --save option for npm install or npm i allows you to add the npm module you’re installing to the file package.json. This way it’ll become one of the project dependencies and will be automatically installed the next time you run npm install....
Node package manager supports semantic versioning. To take full advantage of it, you can use the symbols tilde(~) or caret(^).
Tilde(~) means approximately equivalent to version.
"moment": "~2.29.1" In this example npm install will pick up the latest release of the module moment starting from 2....
In Node.js the command-line arguments are captured in the object process.argv. Let’s start by logging them to the screen.
console.log(process.argv); If you run your script without any arguments, the output will be something like this....