Monday, 28 February 2022

Core Modules in NodeJs

 Some Core Modules In Nodejs is Here :-

1.Path Module some Important function :-



















Output :-















All path module function click Here


2. FS (File System) module :-

  • Create Directory or folder using FS module 















after Running Code test folder will created if folder already exist throw error massage.

  • Create file or write in file using FS module 










after running Code in test folder test.txt file will create and data written in test.txt file 
if test.txt file already exist then data will overwrite in test.txt file 

  • if You want to write some more data(content) in already exist file then we will use :-










after running code data will added in test.txt file   

  • Read file using FS module :-











After running code you will get read data from test.txt file .


all function in FS module Click


3. Operating System Module 


























OUTPUT:-




































Next module in Core module in NodeJS 2


No comments:

Post a Comment

HTTP module in NodeJS(Core module of NodeJS)

 What is HTTP module in Nodejs? To make HTTP requests in Node.js, there is a built-in module  HTTP  in Node.js to transfer data over the HTT...