@ruivalim/lambda-helper
v0.0.27
Published
Simple typescript project boilerplate
Downloads
5
Readme
Lambda Helper
It's a small library to help build lambda functions on AWS
Installation
yarn add @ruivalim/lambda-helperUsage
import {dynamo} from "@ruivalim/lambda-helper"
const ddb = dynamo({tableName: "My-table"});
ddb.get({ ID: "record-id").then(data => {
console.log(data);
});
const saveUser = async(data) => {
await ddb.save(data);
}
saveUser({
ID: "record-id",
name: "Rui Valim",
email: "[email protected]",
admin: true
});
ddb.delete({ID: "record-id}).then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
ddb.scan({ admin: true }).then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
ddb.update({ id: "record-id" }, { name: "Rui Valim Jr" }).then(data => {
console.log(data);
}).catch(err => {
console.log(err);
});
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
