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

node-postbuild-cli

v1.0.4

Published

Postbuild script for node package

Readme

npm npm NPM GitHub Workflow Status (with event)

Description

This tool helps automate post-build processes. It allows you to copy and modify package.json (retaining only essential properties for production), copy specific files to a destination directory, run npm install in the target location, execute custom shell commands, remove specified files/directories, and compress the output directory into a zip file. Tasks are executed in the order they are specified.

Installation

Latest version:

npm i -g node-postbuild-cli@latest

or in working directory

npx node-postbuild-cli --task ...
npx node-postbuild-cli --tasks ...

Usage

USAGE:
$ node-postbuild-cli --tasks ... [options]
$ npbc --tasks ... [options]

Available tasks: `package`, `zip`, `deps`, `copyfiles`, `remove`, `commands`.

- package: Copies `package.json`, keeping only essential properties (e.g., `name`, `version`, `dependencies`).
- copyfiles: Copies files specified in the CLI arguments.
- deps: Installs dependencies in the target `package.json` directory.
- zip: Compresses the specified directory (default: `./dist`) into a zip file.
- remove: Removes files or directories specified in the CLI arguments.
- commands: Runs OS commands specified in the CLI arguments.

Options:
      --help               Show help                                   [boolean]
      --version            Show version number                         [boolean]
  -j, --pkg-src            `package.json` source directory[string] [default: "."]
  -k, --pkg-dst            `package.json` destination directory[string] [default: "./dist"]
  -c, --zip-dir            Directory to compress      [string] [default: "./dist"]
  -d, --zip-out            Output directory for the zip file [string] [default: "./dist-zip"]
  -f, --files-src-to-copy  Source file paths to copy       [array] [default: []]
  -g, --files-dst-to-copy  Destination paths for copied files[array] [default: []]
  -R, --remove             Paths to files or directories to remove [array] [default: []]
  -r, --tasks              Tasks to run, in the specified order
          [array] [choices: "package", "zip", "deps", "copyfiles", "remove", "commands"] [default: []]
  -a, --commands           OS commands to execute           [array] [default: []]

Examples:
  $ npx node-postbuild-cli --tasks package copyfiles deps zip --files-src-to-copy ./.env ./ecosystem.config.js --files-dst-to-copy ./dist/.env ./dist/ecosystem.config.js
  It runs tasks: package, copyfiles, deps, and zip. It copies .env and ecosystem.config.js to ./dist, using default values for other task-specific options.

  $ npx node-postbuild-cli --tasks package deps zip --zip-out ./zipped
  It runs tasks: package and deps with default values, and the zip task with a custom output directory ./zipped.

Example

$ npx node-postbuild-cli --tasks package deps zip
// It copies package.json file from . to ./dist, run npm install in ./dist and zipping ./dist to ./dist-zip/dist.zip

$ npx node-postbuild-cli --tasks package deps zip --pkg-dst ./foo --zip-dir ./foo
// It copies package.json file from . to ./foo, run npm install in ./foo and zipping ./foo to ./dist-zip/dist.zip

$ npx node-postbuild-cli --tasks copyfiles -f ./.env ./config.json -g ./foo/.env ./foo/new_config.json
// It copies files: .env and config.json from . to ./foo directory but changes name of config.json to new_config.json

$ npx node-postbuild-cli --tasks copyfiles zip -f ./.env ./config.json -g ./foo/.env ./foo/new_config.json --zip-dir ./foo
// Same as above, but zips the directory ./foo to ./dist-zip/dist.zip

License

MIT © Damian Polak