aws-sdk-light
v1.3.1
Published
A lightweight version of the AWS SDK that has minimal external dependencies and runs on systems with limited resources
Downloads
39
Readme
AWS SDK Light
This package is primarily focused at enabling Apigee users to integrate with AWS services directly from a JavaScript Policy. However it can certainly be used by anyone.
Although there are already many great libraries that allow integration into AWS services (including the actual aws-sdk!) I found that the situation I was in did not allow me to use them :sob: :rage:.
Key things about why I made this:
- Javascript Policy is the only viable option for me
- The engine used is Rhino JavaScript engine 1.7.7.1
- There are limitations with the current JS version
- Methods cannot exceed 64kb - generated bytecode for method exceeds 64K limit
- ES2015 features and beyond are not supported (including Typed Array) - Rhino ES2015 Support
Installation
Available on npm
npm install aws-sdk-lightOverview
Importing
// import entire SDK
var awsSdkLight = require('aws-sdk-light');
// import single module
var awsSdkLight = require('aws-sdk-light/clients/lambda');Usage
var awsSdkLight = require('aws-sdk-light');
var options = {
accessKeyId: '<value>',
secretAccessKey: '<value>',
region: '<value>'
};
var lambda = new awsSdkLight.Lambda(options);
var params = {
FunctionName: 'hello-world',
Payload: <string>
};
lambda.invoke(params, function(err, data) {
if (err) {
console.log(err);
} else {
console.log(data)
}
});