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

nightdump

v1.2.3

Published

Efficient steaming PostgreSQL backup and restore tool for S3-compatible storage

Readme

Nightdump

A simple, efficient, and robust PostgreSQL backup and restore tool for Node.js using S3-compatible storage (Cloudflare R2, AWS S3, MinIO, etc.).

Features

  • Streaming Architecture: Pipes pg_dump output directly to S3 multipart upload. Zero disk space usage for the dump file on the server.
  • Streaming Restore: Pipes S3 download stream directly to pg_restore.
  • S3/R2 Compatible: Works with any AWS SDK compatible storage.
  • CLI & Programmatic Usage: Use it as a library or a command-line tool.

Installation

npm install nightdump

Pre-requisites:

  • Node.js 18+
  • pg_dump and pg_restore must be installed and available in the system PATH.

Configuration

Create a .env file or ensure these environment variables are set:

# Database Connection (Priority: NIGHTDUMP_DB_URL > DATABASE_URL)
DATABASE_URL=postgresql://user:password@localhost:5432/dbname
# OR if you have multiple DBs and want to be specific:
# NIGHTDUMP_DB_URL=postgresql://user:password@localhost:5432/production_db

S3_ENDPOINT=https://<accountid>.r2.cloudflarestorage.com
S3_REGION=auto
S3_BUCKET=my-backup-bucket
S3_ACCESS_KEY_ID=xxx
S3_SECRET_ACCESS_KEY=xxx
BACKUP_PREFIX=backups

Usage

CLI

Add to your package.json scripts:

"scripts": {
  "backup": "nightdump backup",
  "restore": "nightdump restore"
}

Commands:

  • npx nightdump backup - Creates a new backup.
  • npx nightdump schedule "0 3 * * *" - Starts a long-running process that backs up daily at 3am.
  • npx nightdump restore - Restores the latest backup.
  • npx nightdump restore <path/to/file.dump> - Restores a specific backup.
  • npx nightdump list - Lists available backups.

Programmatic

import { backup, restore, list } from 'nightdump';

// Trigger a backup
await backup();

// List backups
const backups = await list();
console.log(backups);

// Restore the latest
await restore();

License

MIT