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

newapi-sub2api-stack

v0.1.0

Published

One-command Docker Compose installer for upstream New API and Sub2API

Readme

New API + Sub2API Stack Installer

An npm CLI that installs the upstream New API and Sub2API Docker stacks on a Linux host. It generates credentials locally, creates two isolated Compose networks, pulls upstream images, starts the services, and verifies their HTTP health endpoints.

Requirements

  • Linux with Node.js 20 or newer and npx
  • Docker Engine with a running daemon
  • Docker Compose plugin (docker compose)
  • The current user must be able to run docker info without sudo
  • Network access to the npm registry and Docker Hub

Node.js is only needed to run this installer. The applications themselves run entirely in Docker.

Run Locally

From this package directory:

npx --yes . install

Until the package is published, it can also be run by absolute directory:

npx --yes /home/ubuntu/newapi-sub2api-installer install

After publication to npm:

npx --yes [email protected] install

Production automation should specify an exact npm package version instead of @latest.

Commands

api-stack install
api-stack status
api-stack logs
api-stack logs --service new-api
api-stack update
api-stack uninstall
api-stack uninstall --purge --confirm-purge

The default installation directory is ~/.local/share/api-stack. Override it for every command with --install-dir, or set API_STACK_INSTALL_DIR.

Example unattended installation:

npx --yes [email protected] install \
  --new-api-host 0.0.0.0 \
  --new-api-port 3000 \
  --sub2api-host 127.0.0.1 \
  --sub2api-port 8081 \
  --timezone Asia/Shanghai

Installed Services

The generated Compose project contains two isolated networks:

new-api-network                 sub2api-network
  new-api                        sub2api
  new-api-postgres               sub2api-postgres
  new-api-redis                  sub2api-redis

Defaults follow the upstream deployment layouts:

  • calciumion/new-api:latest, PostgreSQL 15, and Redis
  • weishaw/sub2api:latest, PostgreSQL 18 Alpine, and Redis 8 Alpine
  • New API listens on 0.0.0.0:3000
  • Sub2API listens on 127.0.0.1:8081
  • Databases and Redis are not exposed on host ports

Use --new-api-image and --sub2api-image to pin application tags or digests.

Credentials and Data

Credentials are generated with Node's cryptographic random generator and stored in .env with mode 0600. They are never embedded in docker-compose.yml or printed by the installer. The generated Sub2API admin password is stored as SUB2API_ADMIN_PASSWORD in that file. New API completes its initial administrator setup in the web interface.

uninstall preserves all volumes and configuration. Permanent removal requires both --purge and --confirm-purge.

Publishing

Verify the package before publishing:

npm test
npm pack --dry-run
npm publish

The unscoped package name must be available in npm. For an organization scope, change name in package.json to @organization/newapi-sub2api-stack and use the corresponding scoped name in the npx commands.