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鈥檙e installing to the file package.json. This way it鈥檒l 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鈥檚 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....
In the past, updating Node.js was not straightforward as you had to install third-party software and run command lines which can be confusing and introduce bugs to your projects.
Nowadays, It鈥檚 easy to update Node....
One of the most popular formats for exchanging data between backend and frontend is JSON which stands for JavaScript Object Notation. It is very similar to what regular JavaScript objects look like, but it also has its own quirks....
Great, we already have a production server and have done some tasks to better understand how it works. Now let鈥檚 take a look at middleware - one of the most important concepts of Express....
In the last lecture, you saw the server-side analogy of the Hello, world that you wrote as your first task in VSCode. Our program was able to process the request and return a response, which was displayed by the browser....
The rimraf command is an alternative to the Linux command rm -rf. It allows you to do deep recursive deletion of files and folders.
Global rimraf installation You can install rimraf globally using npm....
Today I started writing a new project on Node.js and got this error on the very first run:
const express = require('express'); ^ ReferenceError: require is not defined at ModuleJob.run (node:internal/modules/esm/module_job:152:23) at async Loader....