Posts

Showing posts from December, 2024

What is nodemon? | Lecture 8

  Notes on nodemon Module in Node.js What is nodemon ? nodemon is a utility that helps developers automatically restart a Node.js application whenever file changes are detected. It’s a development tool that improves productivity by eliminating the need to manually restart the server after code modifications. Key Features of nodemon : Monitors file changes in the application directory. Automatically restarts the Node.js server on file updates. Lightweight and easy to configure. Supports custom configurations and scripts. Installing nodemon Globally: Installs nodemon globally, making it available for all projects. o    npm install -g nodemon Use the nodemon command from anywhere. Locally (Recommended): Installs nodemon as a development dependency. o    npm install --save-dev nodemon Use it in a specific project via npm ...

What is package.json? | Lecture 7

  ­­­­­­Notes on package.json File in Node.js What is package.json ? The package.json file is a metadata file for a Node.js project. It defines project properties, scripts, dependencies, and configuration settings. It's essential for managing a Node.js project and ensuring reproducibility. Why is package.json Important? Project Metadata: Contains details about the project, like its name, version, and author. Dependency Management: Lists the dependencies the project needs and their versions. Script Automation: Defines scripts for running common tasks, like starting the server or running tests. Collaboration: Ensures other developers can install the same dependencies using npm install . Creating a package.json File Automatic Creation: Run the following command: o    npm init This command will prompt you to input project details i...