Socket
Socket
Sign inDemoInstall

aws-sdk

Package Overview
Dependencies
15
Maintainers
1
Versions
1924
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    aws-sdk

AWS SDK for JavaScript


Version published
Weekly downloads
9.4M
increased by3.19%
Maintainers
1
Created
Weekly downloads
 

Package description

What is aws-sdk?

The aws-sdk npm package is the official AWS SDK for JavaScript, providing JavaScript objects for AWS services including Amazon S3, EC2, DynamoDB, and more. It allows developers to interact with AWS services programmatically, enabling them to build scalable solutions with AWS infrastructure.

What are aws-sdk's main functionalities?

Interacting with Amazon S3

This code sample demonstrates how to retrieve an object from an Amazon S3 bucket using the aws-sdk.

{"const AWS = require('aws-sdk');
const s3 = new AWS.S3();
const params = { Bucket: 'myBucket', Key: 'myKey' };
s3.getObject(params, function(err, data) {
  if (err) console.log(err, err.stack);
  else console.log(data);
});"}

Managing EC2 Instances

This code sample shows how to describe EC2 instances, providing information about instances running in your AWS account.

{"const AWS = require('aws-sdk');
const ec2 = new AWS.EC2();
const params = { InstanceIds: ['i-1234567890abcdef0'] };
ec2.describeInstances(params, function(err, data) {
  if (err) console.log(err, err.stack);
  else console.log(data);
});"}

Working with DynamoDB

This code sample illustrates how to retrieve an item from a DynamoDB table using the aws-sdk.

{"const AWS = require('aws-sdk');
const dynamoDB = new AWS.DynamoDB();
const params = {
  TableName: 'myTable',
  Key: {
    'myKey': { S: 'myKeyValue' }
  }
};
dynamoDB.getItem(params, function(err, data) {
  if (err) console.log(err, err.stack);
  else console.log(data);
});"}

Other packages similar to aws-sdk

Changelog

Source

2.94.0

  • feature: CodeDeploy: AWS CodeDeploy now supports the use of multiple tag groups in a single deployment group (an intersection of tags) to identify the instances for a deployment. When you create or update a deployment group, use the new ec2TagSet and onPremisesTagSet structures to specify up to three groups of tags. Only instances that are identified by at least one tag in each of the tag groups are included in the deployment group.
  • feature: ConfigService: Added new API, GetDiscoveredResourceCounts, which returns the resource types, the number of each resource type, and the total number of resources that AWS Config is recording in the given region for your AWS account.
  • feature: EC2: Ec2 SpotInstanceRequestFulfilled waiter update
  • feature: ELBv2: Add TargetInService and TargetDeregistered waiters
  • feature: Pinpoint: This release of the Pinpoint SDK enables App management - create, delete, update operations, Raw Content delivery for APNs and GCM campaign messages and From Address override.
  • feature: SES: This update adds information about publishing email open and click events. This update also adds information about publishing email events to Amazon Simple Notification Service (Amazon SNS).

Readme

Source

AWS SDK for JavaScript

NPM

Gitter chat

Version Build Status Coverage Status

The official AWS SDK for JavaScript, available for browsers and mobile devices, or Node.js backends

For release notes, see the CHANGELOG. Prior to v2.4.8, release notes can be found at http://aws.amazon.com/releasenotes/SDK/JavaScript

If you are upgrading from 1.x to 2.0 of the SDK, please see the {file:UPGRADING.md} notes for information on how to migrate existing code to work with the new major version.

Installing

In the Browser

To use the SDK in the browser, simply add the following script tag to your HTML pages:

<script src="https://sdk.amazonaws.com/js/aws-sdk-2.94.0.min.js"></script>

You can also build a custom browser SDK with your specified set of AWS services. This can allow you to reduce the SDK's size, specify different API versions of services, or use AWS services that don't currently support CORS if you are working in an environment that does not enforce CORS. To get started:

http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/building-sdk-for-browsers.html

The AWS SDK is also compatible with browserify.

In Node.js

The preferred way to install the AWS SDK for Node.js is to use the npm package manager for Node.js. Simply type the following into a terminal window:

npm install aws-sdk

In React Native

To use the SDK in a react native project, first install the SDK using npm:

npm install aws-sdk

Then within your application, you can reference the react native compatible version of the SDK with the following:

var AWS = require('aws-sdk/dist/aws-sdk-react-native');

Using Bower

You can also use Bower to install the SDK by typing the following into a terminal window:

bower install aws-sdk-js

Usage and Getting Started

You can find a getting started guide at:

http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide

Usage with TypeScript

The AWS SDK for JavaScript bundles TypeScript definition files for use in TypeScript projects and to support tools that can read .d.ts files. Our goal is to keep these TypeScript definition files updated with each release for any public api.

Pre-requisites

Before you can begin using these TypeScript definitions with your project, you need to make sure your project meets a few of these requirements:

  • Use TypeScript v2.x

  • Includes the TypeScript definitions for node. You can use npm to install this by typing the following into a terminal window:

    npm install --save-dev @types/node
    
  • Your tsconfig.json or jsconfig.json includes 'dom' and 'es2015.promise' under compilerOptions.lib. See tsconfig.json for an example.

In the Browser

To use the TypeScript definition files with the global AWS object in a front-end project, add the following line to the top of your JavaScript file:

/// <reference types="aws-sdk" />

This will provide support for the global AWS object.

In Node.js

To use the TypeScript definition files within a Node.js project, simply import aws-sdk as you normally would.

In a TypeScript file:

// import entire SDK
import AWS = require('aws-sdk');
// import AWS object without services
import AWS = require('aws-sdk/global');
// import individual service
import S3 = require('aws-sdk/clients/s3');

In a JavaScript file:

// import entire SDK
var AWS = require('aws-sdk');
// import AWS object without services
var AWS = require('aws-sdk/global');
// import individual service
var S3 = require('aws-sdk/clients/s3');

Known Limitations

There are a few known limitations with the bundled TypeScript definitions at this time:

  • Service client typings reflect the latest apiVersion, regardless of which apiVersion is specified when creating a client.
  • Service-bound parameters use the any type.

Getting Help

Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests and have limited bandwidth to address them.

Opening Issues

If you encounter a bug with the AWS SDK for JavaScript we would like to hear about it. Search the existing issues and try to make sure your problem doesn’t already exist before opening a new issue. It’s helpful if you include the version of the SDK, Node.js or browser environment and OS you’re using. Please include a stack trace and reduced repro case when appropriate, too.

The GitHub issues are intended for bug reports and feature requests. For help and questions with using the AWS SDK for JavaScript please make use of the resources listed in the Getting Help section. There are limited resources available for handling issues and by keeping the list of open issues lean we can respond in a timely manner.

Supported Services

Please see SERVICES.md for a list of supported services.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE.txt and NOTICE.txt for more information.

Keywords

FAQs

Last updated on 01 Aug 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc