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

onlyonce-cli

v1.0.2

Published

CLI tool for deploying frontend code to Only-Once

Readme

Only-Once CLI

Command-line tool for deploying frontend code to the Only-Once deployment service.

Installation

npm install -g onlyonce-cli

Or use with npx (no installation needed):

npx onlyonce-cli deploy

Usage

Deploy with Auto-Detection

When no directory is provided, the CLI runs your project's build script and auto-detects common output directories (build, dist, out, .next, public):

npx onlyonce-cli deploy

Deploy from Specific Directory

npx onlyonce-cli deploy ./build
npx onlyonce-cli deploy ./dist
npx onlyonce-cli deploy /path/to/your/build

Other Commands

npx onlyonce-cli device-login   # Create or refresh a device session
npx onlyonce-cli --version      # Show version
npx onlyonce-cli --help         # Show help

Configuration

Set the Only-Once API URL via environment variable:

export ONLY_ONCE_API_URL=http://localhost:3000
npx onlyonce-cli deploy

Or create a .env file:

ONLY_ONCE_API_URL=http://localhost:3000

Default API URL: http://localhost:3000

Device Session Storage

The CLI stores the device token and ID in ~/.onlyonce/config.json. Running npx onlyonce device-login refreshes this token and prepares the CLI for future deployments.

How It Works

  1. Build: Runs your project's build script if a directory is not provided
  2. Auto-Detection: Finds common build directories (build, dist, out, .next, public)
  3. Zip: Archives the build output for upload
  4. Deployment: Uploads the zip to the Only-Once API
  5. Result: Returns the live CDN URL where your app is deployed

Examples

React App

npm run build
npx onlyonce-cli deploy ./build

Next.js App

npm run build
npx onlyonce-cli deploy ./out

Vite App

npm run build
npx onlyonce-cli deploy ./dist

Custom Build

# Build your app
npm run build

# Deploy
npx onlyonce-cli deploy ./custom-build-folder

Requirements

  • Node.js 18+
  • Only-Once server running (see only-once)
  • Built frontend project with index.html

Troubleshooting

"Could not detect build directory"

Make sure you're in the project root and have built your project, or specify the directory manually:

npx onlyonce-cli deploy ./build

"Could not connect to Only-Once API"

  1. Make sure the Only-Once server is running
  2. Check the API URL: export ONLY_ONCE_API_URL=http://your-server:3000
  3. Verify network connectivity

"Directory does not contain index.html"

Make sure you're deploying the built/compiled output, not the source code. Most frameworks require a build step:

npm run build  # or yarn build, etc.
npx onlyonce-cli deploy ./build

License

ISC