@sswahn/simple

1.0.0-beta.1 • Public • Published

Simple · License npm version

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

Package Sidebar

Install

npm i @sswahn/simple

Weekly Downloads

0

Version

1.0.0-beta.1

License

MIT

Unpacked Size

7.48 kB

Total Files

9

Last publish

Collaborators

  • sswahn