Node fs.open() Method
To create the file, to write to a file, or to read a file fs.open() method is used. fs.readFile() is only for reading the file and similarly fs.writeFile() is only for writing to a file, whereas fs.open() method does several operations on a file. First, we need to load the fs class which is a module to access the physical file system. For it require method is used. For example: var fs = require(‘fs’);...
read more
Node fs.unlink() Method
`fs.unlink()` in Node.js removes files or symbolic links, while for directories, it’s advisable to use `fs.rmdir()` since it doesn’t support directory removal....
read more
Node util.promisify() Method
`util.promisify()` in Node.js converts callback-based methods to promise-based, aiding in managing asynchronous code more cleanly. This alleviates callback nesting issues, enhancing code readability, and simplifying asynchronous operations through promise chaining....
read more
Node crypto.randomBytes() Method
The crypto.randomBytes() method is used to generate cryptographically well-built artificial random data and the number of bytes to be generated in the written code....
read more
Node process.cwd() Method
The process.cwd() method is an inbuilt application programming interface of the process module which is used to get the current working directory of the node.js process....
read more
Node.js fs.stat() Method
The fs.stat() method is used to return information about the given file or directory. It returns an fs.Stat object which has several properties and methods to get details about the file or directory....
read more
How to Run JavaScript from Python ?
In this article, we’ll discuss how to run a javascript file with Python. For this, we’ll use the JS2PY(Javascript Runtime in Pure Python) Python module. JS2PY works by translating JavaScript directly into Python. It indicates that you may run JS directly from Python code without installing large external engines like V8....
read more
Node crypto.createCipheriv() Method
The crypto.createCipheriv() method is an inbuilt application programming interface of the crypto module which is used to create a Cipher object, with the stated algorithm, key, and initialization vector (iv).Syntax:...
read more
Node crypto.createHash() Method
The crypto.createHash() method is used to create a Hash object that can be used to create hash digests by using the stated algorithm....
read more
How to make HTTP requests in Node ?
In the world of REST API, making HTTP requests is the core functionality of modern technology. Many developers learn it when they land in a new environment.  Various open-source libraries including NodeJS built-in HTTP and HTTPS modules can be used to make network requests from NodeJS....
read more
Node.js process.argv Property
The process.argv property is an inbuilt application programming interface of the process module which is used to get the arguments passed to the node.js process when run in the command line....
read more
Node.js File System
Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine. Node.js helps developers to write JavaScript code to run on the server-side, to generate dynamic content and deliver to the web clients. The two features that make Node.js stand-out are:...
read more