Mayank Agarwal has Published 373 Articles

Inserting Records into Table using Node

Mayank Agarwal

Mayank Agarwal

Updated on 27-Apr-2021 11:20:34

635 Views

In this article, we will see how we can insert data into a table using NodeJS. Read the complete article to understand how we can save data into the database table.Before proceeding, please check the following steps are already executed −mkdir mysql-testcd mysql-testnpm init -ynpm install mysqlThe above steps are ... Read More

Image Processing with NodeJS JIMP

Mayank Agarwal

Mayank Agarwal

Updated on 27-Apr-2021 11:18:01

994 Views

JIMP, also known as JavaScript Image Manipulation Program, is an image processing library for Node written in JavaScript with no other dependency. It allows the user to easily manipulate the and transform the images into any required shape, format, dimnesion or style. It can also be used for optimizing images ... Read More

ensureSymlink() function in fs-extra - NodeJS

Mayank Agarwal

Mayank Agarwal

Updated on 27-Apr-2021 11:13:29

377 Views

Introduction to Async ensureSymlink()This method will ensure whether the symlink exists or not. It will create the directory structure if it does not exist.SyntaxcreateSymlink(srcPath, destPah[, type] [, callback])ParameterssrcPath – The source path of the file.destPath – Destination path of the file.type – This parameter is only available on Windows and ... Read More

Introduction to ensureFileSync() in NodeJS

Mayank Agarwal

Mayank Agarwal

Updated on 27-Apr-2021 11:09:43

393 Views

This method is used to ensure that a file exists at the given location by using a sync process. The response will only be given after the processing is completed. If the files that is ensured to be created is not present or the respective directories are not present, these ... Read More

ensureFile() function in fs-extra - NodeJS

Mayank Agarwal

Mayank Agarwal

Updated on 27-Apr-2021 11:07:21

238 Views

Introduction to Async ensureFile()This method is used to ensure that a file exists at the given location. If the files that is ensured to be created is not present or the respective directories are not present, these directories and files are created. If the file already exists, it is not ... Read More

Introduction to Sync emptyDir() in NodeJS

Mayank Agarwal

Mayank Agarwal

Updated on 27-Apr-2021 09:37:47

323 Views

This method is used to empty a directory whether it is empty or not with a sync process. If the directory is not empty, it will remove all its contents and empty it. A new empty directory is created if the directory does not exist.SyntaxemptyDirSync(dir)Parametersdir – This is a string ... Read More

EmptyDir() function in fs-extra - NodeJS

Mayank Agarwal

Mayank Agarwal

Updated on 27-Apr-2021 09:36:08

379 Views

Introduction to Async emptyDir()This method is used to empty a directory whether it is empty or not. If the directory is not empty it will remove all its contents and empty it. A new empty directory is created if the directory does not exist.SyntaxemptyDir(dir, [, callbacks])Parametersdir – This is a ... Read More

Dropping a MySQL Table using NodeJS

Mayank Agarwal

Mayank Agarwal

Updated on 27-Apr-2021 09:34:02

645 Views

You can delete an existing table from MySql Database using the "DROP TABLE" statement in Node. Sometimes, we need to delete the whole table, though in corporates it is always advised to archive the tables which are not in used instead of deleting them.While deleting a table, we have two ... Read More

Difference between process.cwd & _ _dirname in NodeJS

Mayank Agarwal

Mayank Agarwal

Updated on 27-Apr-2021 09:30:12

537 Views

NodeJS is a JavaScript runtime environment that was built on top of Chrome's V8 engine. The traditional use of JavaScript is to be executed in browsers, but with Node.JS we can execute JavaScript other than browsers like servers, hardware devices, etc.process.cwd()The process object lies under the global object known as ... Read More

Difference between console.log and process.stdout.write in NodeJS

Mayank Agarwal

Mayank Agarwal

Updated on 27-Apr-2021 09:27:06

1K+ Views

Both the methods – console.log and process.stdout.write have a basic definition to write or print the statements on the console. But, there is a slight difference in the way they execute these tasks. Internally, console.log implements process.stdout.write which itself is a buffer stream that will be used to directly print ... Read More

Advertisements