logo

Node.JS

Cloud

AWS DynamoDB : Query Multiple Items in Node.js

There is no DynamoDB API to query multiple items by primary key in a single operation. However BatchGetItemCommand can be used to batch multiple read requests and get up to 100 items.
15 July 2024
Cloud

AWS DynamoDB Write Transactions in Node.js

Write transactions are supported in DynamoDB's Node SDK via the TransactWriteItemsCommand method. Transactions can include up to 100 insert, update or delete operations. Either all of the operations will be successful or nothing will be successful.
15 July 2024
Cloud

Get All Rows from DynamoDB Table (Scan or Query) using Node.js

DynamoDB has a maximum limit of 1 MB in its Query or Scan API responses. To get the full data we need to make use of the LastEvaluatedKey response attribute.
22 June 2024
Cloud

Create DynamoDB Tables (with Index) using Node.js

Tables can be created in DynamoDB using the CreateTableCommand() method of the AWS DynamoDB Javascript SDK.
21 June 2024
Cloud

Check DynamoDB Tables Exist using Node.js

We can check whether specific DynamoDB tables exist using the AWS Javascript SDK. The ListTablesCommand method can be used to list DynamoDB tables in a region.
18 June 2024
Node.JS

How to Install and Use AWS Node.js SDK - Getting Started Tutorial

This tutorial discusses installation of AWS Node.js SDK and getting started with it.
3 July 2020
Node.JS

Get Date and Time for a Given Timezone in Node.js

The toLocaleString() method of the Date() object can be used to get date and time for a given IANA timezone name in Node.
10 February 2020
Node.JS

Base64 Encoding and Decoding in Node.JS

Node.js does not support the standard Javascript methods of atob() and btoa() for base64 conversions. Encoding and decoding base64 data in Node can be done through the inbuilt Buffer module.
1 February 2020
Node.JS

Getting Date and Time in Node.js

In Node.js date and time are handled with the Javascript Date object. It is loaded by default and requires no import of modules.
29 June 2019
Node.JS

Creating and Starting a Web Server in Node.js

The built-in http / https modules can be used to create a HTTP / HTTPS server in Node.
8 June 2019
Node.JS

Making Synchronous HTTP Requests in Node.js

A synchronous HTTP request will wait for the request to be made and full response to come. Synchronous HTTP requests are possible in Node.js with the use of Javascript Promises, async and await.
21 May 2019
Node.JS

Making GET Requests in Node.JS

HTTP GET requests can be made through Node using the http module.
16 May 2019
Node.JS

Making POST Requests in Node.JS

This tutorial discusses how to send a HTTP POST request from Node using the http module.
14 May 2019
Node.JS

Running Cron Jobs in Node.js

Cron jobs are important when some script is required to be executed at a fixed time over and over again. In Node.js cron jobs can be setup using an external module known as node-cron.
15 January 2019
Javascript

Using the Reviver Function in JSON.parse

JSON.parse accepts an optional second parameter - the reviver function. The purpose of this function is to modify the result before returning, and can be thought of as filter function.
9 January 2019
Node.JS

Reading JSON in Node.js

The standard built-in Javascript object JSON can be used to parse json strings.
3 January 2019
Node.JS

Reading XML in Node.js

The "xml2js" module can be used to read XML files in Node. In case if the file is huge, the "node-xml-stream" module can be used to read XML as a stream.
27 December 2018
Node.JS

How to Crop Images in Node.js

The Sharp module can be used to crop an image in Node.
21 December 2018
Node.JS

Resizing Images in Node.js

The Sharp Node.js module can be used to resize large images of any common file-type to web-friendly images of any dimension. It claims to be multiple times faster than ImageMagick and GraphicsMagick.
4 December 2018
Node.JS

Node.js - Reading a File Line by Line

In some cases you may need to read a file, line by line, asynchronously. This can be done by the Readline module that reads data from a readable stream and emits an event after reading each line.
22 November 2018