当前位置: 首页 > 软件库 > 云计算 > >

aws-sdk-js

AWS SDK for JavaScript in the browser and Node.js
授权协议 Apache-2.0 License
开发语言 JavaScript
所属分类 云计算
软件类型 开源软件
地区 不详
投 递 者 贾飞章
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

AWS SDK for JavaScript

Version 3.x Now Available

The version 3.x of the AWS SDK for JavaScript is generally available.For more information see the Developer Guideor API Reference.

For release notes, see the CHANGELOG. Prior to v2.4.8, release notes can be found at https://aws.amazon.com/releasenotes/?tag=releasenotes%23keywords%23javascript

Table of Contents:

Getting Started

How To Install

In the Browser

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

<script src="https://sdk.amazonaws.com/js/aws-sdk-2.1004.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 ofservices, or use AWS services that don't currently support CORS if you areworking 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.

For browser-based web, mobile and hybrid apps, you can use AWS Amplify Library which extends the AWS SDK and provides an easier and declarative interface.

In Node.js

The preferred way to install the AWS SDK for Node.js is to use thenpm package manager for Node.js. Simply type the followinginto 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');

Alternatively, you can use AWS Amplify Library which extends AWS SDK and provides React Native UI components and CLI support to work with AWS services.

Using Bower

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

bower install aws-sdk-js

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
  • If you are targeting at es5 or older ECMA standards, your tsconfig.json has to include 'es5' 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 from 'aws-sdk';
// import AWS object without services
import AWS from 'aws-sdk/global';
// import individual service
import S3 from 'aws-sdk/clients/s3';

NOTE: You need to add "esModuleInterop": true to compilerOptions of your tsconfig.json. If not possible, use like import * as AWS from 'aws-sdk'.

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');

With React

To create React applications with AWS SDK, you can use AWS Amplify Library which provides React components and CLI support to work with AWS services.

With Angular

Due to the SDK's reliance on node.js typings, you may encounter compilationissues when using thetypings provided by the SDK in an Angular project created using the Angular CLI.

To resolve these issues, either add "types": ["node"] to the project's tsconfig.app.jsonfile, or remove the "types" field entirely.

AWS Amplify Library provides Angular components and CLI support to work with AWS services.

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

The best way to interact with our team is through GitHub.You can open an issue and choose from one of our templates forbug reports,feature requestsor guidance.You may also find help on community resources such as StackOverFlow with the tag #aws-sdk-js.If you have a support plan with AWS Support, you can also create a new support case.

Please make sure to check out our resources too before opening an issue:

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

Maintenance and support for SDK major versions

For information about maintenance and support for SDK major versions and their underlying dependencies, see the following in the AWS SDKs and Tools Shared Configuration and Credentials Reference Guide:

Contributing

We welcome community contributions and pull requests. See CONTRIBUTING.md for information on how to set up a development environment and submit code.

License

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

  • AWS 提供多语言SDK连接S3存储服务,本文主要描述使用jsSDK连接私有S3节点 const AWS = require('aws-sdk'); AWS.config.update({region: 'eu-west-1'}); var s3 = new AWS.S3({ apiVersion: '2006-03-01', accessKeyId: 'xxxx', secret

  • 背景 原本通过 NFS 的方式实现了和私有云(腾讯)的对接,但是 NFS 的方式上传文件会有延时,所以不得不通过其他方式上传文件。通过集成 aws-sdk,用类的方式封装了 s3 实例的创建过程和上传逻辑,提供更加简便的上传入口。 实现 封装上传逻辑 这里只是简单使用了上传的功能,而且是对接的私有云,更多关于 sdk 的使用方法可以参考官方 API 文档。 引入 sdk 依赖 npm instal

  • 我的环境是 vue+electron 7.1.1+sqlite3 在集成sqlite3的时候出现两个问题(安装python27和node-pre-gyp环境以及vstools略过) 1. Module not found: Can't resolve 'aws-sdk' 2. Cannot read property '_handle' of undefined 这两个问题是接连发生的,始终不能正

  • 背景 原本通过 NFS 的方式实现了和私有云(腾讯)的对接,但是 NFS 的方式上传文件会有延时,所以不得不通过其他方式上传文件。通过集成 aws-sdk,用类的方式封装了 s3 实例的创建过程和上传逻辑,提供更加简便的上传入口。 实现 封装上传逻辑 这里只是简单使用了上传的功能,而且是对接的私有云,更多关于 sdk 的使用方法可以参考官方 API 文档。 引入 sdk 依赖 npm instal

  • 前言 错误信息: These dependencies were not found: * aws-sdk in ./node_modules/fsevents/node_modules/node-pre-gyp/lib/info.js, ./node_modules/fsevents/node_modules/node-pre-gyp/lib/publish.js and 1 other *

 相关资料
  • 设置 你可以用全局方法配置连接: Aws.config.update( endpoint: 'https://objects.dreamhost.com.', access_key_id: 'my-access-key', secret_access_key: 'my-secret-key', force_path_style: tr

  • aws-sdk-perl Attempt to build a complete AWS SDK in Perl This project is attempting to build an entire AWS SDK from the informationthat is stored in other AWS SDKs. Other AWS SDKs have a "data-driven"

  • AWS SDK for Ruby - Version 3 Links of Interest API Documentation Developer Guide V3 Upgrading Guide AWS Developer Blog Github Discussions Installation The AWS SDK for Ruby is available from RubyGems.

  • AWS SDK for Java The AWS SDK for Java enables Java developers to easily work with Amazon Web Services andbuild scalable solutions with Amazon S3, Amazon DynamoDB, Amazon Glacier, and more. You can get

  • AWS SDK for Android Samples This repository has samples that demonstrate various aspects of the AWS SDK for Android. Resources Developer Guide for AWS SDK for Android Please refer to README file in ea

  • The AWS SDK for iOS Samples This repository has samples that demonstrate various aspects of the AWS SDK for iOS. Resources Developer Guide for AWS SDK for iOS Please refer to README.md in each sample