npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@scloud/s3

v0.0.12

Published

Functions for s3 CRUD and list.

Downloads

125

Readme

s3 CRUD utility functions

A collection of wrapper functions for the AWS SDKv3 that provide simplified CRUD and list operations.

This is intended to provide you with the operations you'll mostly need most of the time and, if you have an edge-case, you can use this as example code to help you get what you need done more easily.

Changelog

  • 0.0.11: Add copyObject and remove console.error() output in src/s3.ts
  • 0.0.10: Fix moveObject and shortcut return from deleteObjects if the object list is empty. Also make error messages unique so we can distinguish if an error is coming from deleteObject or deleteObjects. Also added generic type information to getJson and putJson.
  • 0.0.9: Add deleteObjects
  • 0.0.8: Return ETag when listing objects
  • 0.0.7: Fix typos in documentation
  • 0.0.6: Return object size and modification date from listObjects. This allows the caller to have more information about an object (example use-case: determine if new content to be put differs from the existing content in the same way aws s3 sync does - https://stackoverflow.com/a/43531938/723506).

Functions

This package allows you to work with binary and JSON objects.

Binary objects

  • putObject(bucket, key, object): puts content to s3
  • getObject(bucket, key): gets content from s3

JSON objests

  • putJson(bucket, key, object): stringifies the object and puts it to s3
  • getJson(bucket, key): gets content from s3 and parses it as JSON

List and delete

  • deleteObject(bucket, key): deletes an object from s3
  • deleteObjects(bucket, keys[]): deletes multiple objects from s3
  • listObjects(bucket, prefix): lists matching keys from the bucket
  • objectExists(bucket, key): determines whether a single matching key exists in the bucket