NodeJs 2nd Class
Sure, let's go through each concept with examples: Nodemon Module Concept Nodemon is a tool that helps develop Node.js based applications by automatically restarting the application when file changes are detected in the directory. Installation: npm install -g nodemon Usage: Instead of running your app with `node app.js`, you can run it with: nodemon app.js Nodemon will automatically restart your server whenever you make changes to your files. URL Module The URL module splits up a web address into readable parts. Example: const url = require('url'); const address = 'http://example.com:8080/default.htm?year=2023&month=july'; const parsedUrl = url.parse(address, true); console.log(parsedUrl.host); // 'example.com:8080' console.log(parsedUrl.pathname); // '/default.htm' console.log(parsedUrl.search); // '?year=2023&month=july' const queryData = parsedUrl.query; console.log(queryData.year); // '2023' console.log(queryData.month);