Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Node.js considerations

Focus mode
Node.js considerations - AWS SDK for JavaScript

The AWS SDK for JavaScript V3 API Reference Guide describes in detail all the API operations for the AWS SDK for JavaScript version 3 (V3).

The AWS SDK for JavaScript V3 API Reference Guide describes in detail all the API operations for the AWS SDK for JavaScript version 3 (V3).

Although Node.js code is JavaScript, using the AWS SDK for JavaScript in Node.js can differ from using the SDK in browser scripts. Some API methods work in Node.js but not in browser scripts, as well as the other way around. And successfully using some APIs depends on your familiarity with common Node.js coding patterns, such as importing and using other Node.js modules like the File System (fs) module.

Use built-in Node.js modules

Node.js provides a collection of built-in modules you can use without installing them. To use these modules, create an object with the require method to specify the module name. For example, to include the built-in HTTP module, use the following.

import http from 'http';

Invoke methods of the module as if they are methods of that object. For example, here is code that reads an HTML file.

// include File System module import fs from "fs"; // Invoke readFile method fs.readFile('index.html', function(err, data) { if (err) { throw err; } else { // Successful file read } });

For a complete list of all built-in modules that Node.js provides, see Node.js documentation on the Node.js website.

Use npm packages

In addition to the built-in modules, you can also include and incorporate third-party code from npm, the Node.js package manager. This is a repository of open source Node.js packages and a command-line interface for installing those packages. For more information about npm and a list of currently available packages, see https://www.npmjs.com. You can also learn about additional Node.js packages you can use here on GitHub.

On this page

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.