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 🙏

© 2026 – Pkg Stats / Ryan Hefner

repos-wrapper-s3

v1.8.3

Published

A handful wrapper to main S3 commands.

Readme

AWS S3 Wrapper Library

A handful wrapper to main S3 commands.

this library supports "old" S3-JS-API (S3 / 'aws-sdk') as well as "new" (v3) S3-JS-API (S3Client, '@aws-sdk/client-s3').

Message from AWS:

NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).

The creation of S3 client is more flexible because each user-application may has its own configuration (in previous version, there was only the region parameter in the constructor).

usage:

const config = {
    credentials: {
      accessKeyId: 'minio-user',
      secretAccessKey: 'minio-password',
    },
    endpoint: 'http://127.0.0.1:9000',
    forcePathStyle: true,
};

const s3api: S3Api = new S3Api(config);
await s3api.uploadFile(bucket, key, file-path);

Build and Deploy

npm install
npm run build
npm version patch
npm publish
git push

note that npm run build invokes prebuild script, to clean dist folder.

logs

This library uses log4js. However, rather than being dependent on a specific version of log4js, in order to avoid dependencies headache for this library users, it is dependent on @log4js-node/log4js-api.

The hosting-application can easily control the log-level of this library. In the unit-tests (/test/log-config.ts) there is a good example:

categories: {
    default: { appenders: ['out'], level: 'trace' },
    'repos-wrapper': { appenders: ['out'], level: 'debug' }
}

This way the hosting-application will print its own 'trace' logs (and up), but only 'debug' level logs (and up) from repos-wrapper.

Tests

manual tests

set AWS_PROFILE=<profile-from-.aws-credentials>
set AWS_REGION=us-east-1
ts-node test\internal-tests.ts

mocha unit-tests

Use the unit tests as example of how to use this library.

load env-vars from file:

for /F %A in (envs\local-minio.env) do SET %A
for /F %A in (envs\real-aws.env) do SET %A

run:

npx mocha --inspect --exit dist\test\main.test.js
npx mocha --inspect --exit dist\test\**.*.js

versions

1.3.0

  • reduce logs: S3 copyObject() from - #4
  • check if need to handle ContinuationToken in listObjectsV2 - #2
  • listObjects: prefer listObjectsV2 - #1

1.4.0

  • upload V2: support also readable (not only file) #13
  • reduce logs - upload file #12
  • tests: upload >1000 objects, to test the listObjects, copyFolder and deleteFolder #11
  • exists(): return false only if AWS throws 404 #10
  • unit tests: "TooManyBuckets: You have attempted to create more buckets than allowed" #9
  • support minio in tests + CI/CD #8
  • tests: create bucket on init (and support API) #7
  • tests: use logger #6
  • add tests for copyObject #5

1.4.2 - critical fixes for 1.4.0

  • CRITICAL BUG: since adding "test" to tsconfig, path under dist is different so 'customers' cannot import classes #15
  • use .npmignore to exclude tests from package #14

1.5.0

  • support signed url (for V2) #16

1.6.0

  • support signed url (for V3) #16
  • improve tests: use mocha #17
  • refactor: make abstract Base class for V2/V3 impl. #18
  • only for tests (Minio): cannot create an already-existing-bucket #19

1.7.0

  • allow extension of APIs (both V2 + V3) #20
  • V3 dev: #21, #25, #26, #27, #30, #32
  • code reuse among V2 and V3: #22, #29, #33
  • tests: #24, #28

1.8.0

  • upload: allow params ContentEncoding and ContentType #34
  • deprecate getObjectAsText: use AWS' SdkStreamMixin.transformToString() #35
  • more units tests - use them as example of how to use this library.

1.8.2

  • enable upload zipped file with the zip flags #37