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

@vlsdev/s3-portable

v1.1.0

Published

Portable S3 service package for microservices.

Readme

@vlsdev/s3-portable

Portable S3 service for Node.js microservices with TypeScript, DDD layers, and SOLID-oriented design.

Install

npm i @vlsdev/s3-portable

Requirements

  • Node.js 18+
  • AWS credentials with S3 permissions (s3:GetObject, s3:PutObject, s3:ListBucket, s3:DeleteObject)

Environment variables

AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY
AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY
AWS_S3_BUCKET_NAME=your-bucket

Quick start (from env)

import "dotenv/config";
import { createS3ServiceFromEnv } from "@vlsdev/s3-portable";

const s3Service = createS3ServiceFromEnv();

const files = await s3Service.listFiles("billing-service", "invoices");
console.log(files);

Explicit config

import { createS3Service } from "@vlsdev/s3-portable";

const s3Service = createS3Service({
  region: process.env.AWS_REGION!,
  accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
  secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
  bucketName: process.env.AWS_S3_BUCKET_NAME!,
});

API

downloadFile(project, path, fileName)

Returns the S3 object body stream.

const body = await s3Service.downloadFile("billing-service", "invoices", "invoice-1.pdf");

uploadFile(project, path, fileName, body, contentType?)

Uploads a file to the bucket and returns a success message.

await s3Service.uploadFile(
  "billing-service",
  "invoices",
  "invoice-1.pdf",
  Buffer.from("file content"),
  "application/pdf"
);

listFiles(project, path)

Returns object keys under project/path/.

const keys = await s3Service.listFiles("billing-service", "invoices");

deleteFile(project, path, fileName)

Deletes a file and returns a success message.

await s3Service.deleteFile("billing-service", "invoices", "invoice-1.pdf");

generateSignedUrl(project, path, fileName, expiresIn?)

Generates a signed GET URL (default expiration: 3600 seconds).

const url = await s3Service.generateSignedUrl(
  "billing-service",
  "invoices",
  "invoice-1.pdf",
  900
);

Express example

import express from "express";
import "dotenv/config";
import { createS3ServiceFromEnv } from "@vlsdev/s3-portable";

const app = express();
const s3 = createS3ServiceFromEnv();

app.get("/files/:project/:path/:fileName/url", async (req, res) => {
  const { project, path, fileName } = req.params;
  const url = await s3.generateSignedUrl(project, path, fileName, 300);
  res.json({ url });
});

app.listen(3000);

Error handling

This package throws:

  • DomainError for invalid input/configuration
  • AWS SDK errors for infrastructure failures
import { DomainError } from "@vlsdev/s3-portable";

try {
  await s3Service.generateSignedUrl("p", "docs", "file.pdf", 0);
} catch (error) {
  if (error instanceof DomainError) {
    console.error("Validation error:", error.message);
  }
}