@sswahn/simple
v1.0.0-beta.1
Published
This library simplifies common CRUD operations using Amazon S3 (Simple Storage Service), providing a convenient and intuitive interface.
Downloads
9
Readme
Simple ·
This library simplifies common CRUD operations using Amazon S3 (Simple Storage Service), providing a convenient and intuitive interface.
Features
- Seamless CRUD Operations: Perform Create, Read, Update, and Delete operations with minimal effort. The library streamlines S3 interactions.
- Robust Error Handling: The library incorporates robust error handling. Receive clear and actionable error messages for quick troubleshooting.
Installation
Using npm.
npm install @sswahn/simple
Usage
Import
import simple from '@sswahn/simple'
Create
Add an object to your S3 bucket.
const response = await simple.create(data)
Read
Retrieve all objects from your S3 bucket. Optionally, set a limit to control the listed number of returned objects.
const response = await simple.read(limit)
Read One
Retrieve an individual object from an S3 bucket using a key.
const response = await simple.readOne(key)
Update
Update an existing object in your S3 bucket.
const response = await simple.update(data, key)
Remove
Delete an object from your S3 bucket. Provide the key of the object to remove.
const response = await simple.remove(key)
Environmental Variables
Ensure the following environmental variables are set:
- BUCKET_NAME: The name of your S3 bucket.
License
Simple is MIT Licensed