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

nestjs-seaweedfs

v1.0.4

Published

Production-grade NestJS SDK for SeaweedFS — Filer REST API + S3 Gateway API

Readme

nestjs-seaweedfs

License Version

Unofficial, community-maintained NestJS SDK for SeaweedFS. Full support for both the Filer REST API and the S3 Gateway API as first-class features.

Not affiliated with, endorsed by, or associated with NestJS, SeaweedFS, or their respective maintainers.

Features

  • Filer REST API — upload, download, delete, list, metadata, directory management, TTL, replication, collections, volume assignment
  • S3 Gateway API — multipart uploads, presigned URLs, bucket management, batch deletes
  • Dynamic Module — forRoot, forRootAsync (useFactory/useClass/useExisting/inject), register for feature-level instances
  • Connection Validation — validates Filer and S3 Gateway connectivity on boot
  • Retry Logic — exponential backoff for transient failures
  • Typed Exceptions — SeaweedFsException hierarchy with meaningful context
  • Escape Hatches — raw S3Client and AxiosInstance access

Installation

npm install nestjs-seaweedfs

Peer dependencies (@nestjs/common, @nestjs/core, reflect-metadata, rxjs) are typically already installed.

Quick Start

import { Module } from '@nestjs/common';
import { SeaweedFsModule } from 'nestjs-seaweedfs';

@Module({
  imports: [
    SeaweedFsModule.forRoot({
      filer: { url: 'http://localhost:8888' },
      s3: {
        endpoint: 'http://localhost:8333',
        accessKeyId: 'your-access-key',
        secretAccessKey: 'your-secret-key',
        forcePathStyle: true,
        defaultBucket: 'my-bucket',
      },
    }),
  ],
})
export class AppModule {}
import { Injectable } from '@nestjs/common';
import { SeaweedFsService } from 'nestjs-seaweedfs';

@Injectable()
export class FileService {
  constructor(private readonly seaweed: SeaweedFsService) {}

  async uploadFile() {
    return this.seaweed.upload('/uploads/doc.pdf', Buffer.from('content'), {
      ttl: 86400,
      replication: '001',
      collection: 'documents',
    });
  }

  async s3Upload() {
    return this.seaweed.s3PutObject('my-bucket', 'key', Buffer.from('data'));
  }
}

API Reference

| Method | Description | | ------------------------------------------------------ | --------------------------------- | | upload(path, file, options?) | Upload file via Filer | | download(path) | Download as Readable stream | | downloadToBuffer(path) | Download as Buffer | | delete(path, options?) | Delete file | | exists(path) | Check if file/directory exists | | getMetadata(path) | Get file metadata | | listDirectory(path, options?) | List directory with pagination | | assignVolume() | Assign a volume via Master server | | s3PutObject(bucket, key, body, options?) | Put an object | | s3GetObject(bucket, key) | Get object as stream | | s3GetObjectAsBuffer(bucket, key) | Get object as Buffer | | s3DeleteObject(bucket, key) | Delete object | | s3DeleteObjects(bucket, keys) | Batch delete objects | | s3HeadObject(bucket, key) | Get object metadata | | s3ListObjects(bucket, options?) | List objects with pagination | | s3CopyObject(srcBucket, srcKey, destBucket, destKey) | Copy object | | s3CreateBucket(bucket) | Create bucket | | s3DeleteBucket(bucket) | Delete bucket | | s3BucketExists(bucket) | Check if bucket exists | | s3ListBuckets() | List all buckets | | s3GetPresignedUploadUrl(bucket, key, options?) | Generate presigned upload URL | | s3GetPresignedDownloadUrl(bucket, key, options?) | Generate presigned download URL | | s3SetBucketPolicy(bucket, policy) | Throws unsupported error |

Documentation

| Guide | Description | | ------------------------------------------------ | ------------------------------------------------- | | Getting Started | Installation, peer dependencies, and verification | | Quick Start | Get running in under 5 minutes | | NestJS Integration | Module configuration, async setup, DI | | Filer API | Full Filer REST API operations reference | | S3 API | S3 Gateway operations including presigned URLs |

Configuration

interface SeaweedFsModuleOptions {
  filer: { url: string; timeout?: number; retries?: number };
  masterUrl?: string;
  s3: {
    endpoint: string;
    accessKeyId: string;
    secretAccessKey: string;
    region?: string;
    forcePathStyle?: boolean;
    defaultBucket?: string;
  };
  isGlobal?: boolean;
  validateConnectionOnBoot?: boolean;
}

Support

License

MIT