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

@tryhuset/foundation-utils

v4.85.0

Published

Public utility CLI tools for Foundation server framework. Provides generic tools for database and Docker management.

Downloads

534

Readme

@tryhuset/foundation-utils

Public utility CLI tools for Foundation server framework. Provides generic tools for database and Docker management that can be installed without GitHub Personal Access Tokens.

Installation

npm install -g @tryhuset/foundation-utils

Usage

Database management

foundation-utils db list      # List sessions
foundation-utils db restore   # Restore a session by ID (ends current active if any)
foundation-utils db export    # Export database to mongodump backup
foundation-utils db import    # Import database from mongodump backup
foundation-utils db end       # End all active sessions

Requires STORAGE_URL environment variable. Use -e, --env <path> to load from a .env file.

db list – List sessions (default 50, newest first). Use -a, --active for active only, -l, --limit <n> to change limit.

db restore – Restore a session by ID. Ends the current active session if one exists. Requires -i, --id <sessionId>. Restart the server to pick up the restored session.

db export – Create mongodump backup. Requires -o, --out <path> for output directory.

db import – Import from mongodump backup. Requires -p, --path <path> to dump directory.

db end – Ends all sessions by updating endedAt with null to have the current date.

Docker Compose management

Uses ./compose.yaml by default. Override with -f, --file <path>.

# Update images with backup (default: ./compose.yaml)
foundation-utils docker update

# Create backup only
foundation-utils docker backup

# Restore stack from a backup compose file (from docker backup output)
foundation-utils docker backup --restore ./docker_image_backups/docker-compose_20260101T120000.yaml

# Update without backup
foundation-utils docker update --no-backup

# Force without confirmation (e.g. restore)
foundation-utils docker backup --restore ./docker_image_backups/docker-compose_20260101T120000.yaml --force
foundation-utils docker update --force

# Restart a specific service
foundation-utils docker restart -s <service-name>

# List containers (docker compose ps)
foundation-utils docker list

Programmatic Usage

import { Command } from 'commander';
import {
  registerCommands,
  dbEnd,
  dbExport,
  dbImport,
  dbList,
  dbRestore,
  dockerBackup,
  dockerList,
  dockerRestart,
  dockerUpdate
} from '@tryhuset/foundation-utils';

// Attach all db + docker subcommands to a Commander program
const program = new Command();
registerCommands(program);

// End all active sessions
await dbEnd();

// List sessions
await dbList({ active: true });

// Restore a session by ID
await dbRestore({ sessionId: 'abc123', force: true });

// Export database backup
await dbExport({ path: './backup' });

// Import from backup
await dbImport({ path: './backup' });

// Create backup only
await dockerBackup();

// Update Docker images (default: ./compose.yaml)
await dockerUpdate({ force: true });

// Restore stack from backup compose file (same as: docker backup --restore <path>)
await dockerUpdate({ backupFile: './docker_image_backups/docker-compose_20260101T120000.yaml', force: true });

// Restart a service
await dockerRestart({ service: 'api' });

// List containers
await dockerList();

License

MIT