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

deploy-static

v0.4.0

Published

Deploy static files with a static.json file

Downloads

18

Readme

deploy-static

NPM License Downloads

This is a command built with Node.js to facilitate deployment of static files.

Installation

$ npm i deploy-static -g

Usage

Before deployment, you should upload your static files somewhere and build a list in static.json.

static.json may be an array of {url, path} items, or an object with a files property containing such an array.

{
  "version": "v1.0",
  "files": [{
    "url": "http://my.storage.com/assets/app.js",
    "path": "assets/app.js"
  }, {
    "url": "assets/app.css",
    "path": "assets/app.css"
  }]
}

Each item has a remote url and local path mapping. urls can be both absolute or relative paths.

Then deploy your static files with the command below.

$ deploy-static fetch static.json -t v1.0 -p http://my.storage.com/

After that you will get directory architecture like this:

▾ ./
  ▸ current/ -> versions/v1.0/     # symlink to current version
  ▸ versions/
    ▸ v0.8/
    ▸ v0.9/
    ▸ v1.0/                        # latest version

The latest version will be linked to ./current while the history versions are kept in ./versions so that you can easily rollback.

Note that if the url is relative, the prefix parameter must be assigned. static.json is also an url, either absolute or relative.

Documents

  • deploy-static fetch
usage: deploy-static fetch [-h] [-d DIST] [-V] [-t TAG] [-f] [-p PREFIX] [-S]
                           static

Positional arguments:
  static                the URL or path of static.json, stdin will be read if
                        none is provided

Optional arguments:
  -h, --help            Show this help message and exit.
  -d DIST, --dist DIST  the directory to hold the static files
  -V, --verbose         Show verbose log.
  -t TAG, --tag TAG     the tag of current version, will be used as the
                        subdirectory name, default as current date
  -f, --force           whether to reuse files in an existed tag
  -p PREFIX, --prefix PREFIX
                        the URL prefix for all items with relative paths
  -S, --save-static     whether to store the static.json file
  • deploy-static link
usage: deploy-static link [-h] [-d DIST] tag

Positional arguments:
  tag         the tag or folder name of the version to be linked

Optional arguments:
  -h, --help  Show this help message and exit.
  -d DIST, --dist DIST  the directory to hold the static files
  -V, --verbose         Show verbose log.
  • deploy-static clean
usage: deploy-static clean [-h] [-d DIST] [-t TAG [TAG ...]] [-n NUMBER]
                           [-k KEEP] [-N]


Optional arguments:
  -h, --help            Show this help message and exit.
  -d DIST, --dist DIST  the directory to hold the static files
  -V, --verbose         Show verbose log.
  -t TAG [TAG ...], --tag TAG [TAG ...]
                        Remove obsolete versions by tags.
  -n NUMBER, --number NUMBER
                        Remove the first NUMBER of obsolete versions. If
                        value not provided, the first one will be removed.
  -k KEEP, --keep KEEP  Remove obsolete versions and keep last KEEP ones. If
                        value not provided, the last 4 will be kept.
  -N, --dry             Show versions to be cleaned and exit.

deploy-static