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

dev-dump

v0.0.1

Published

Zero-dependency CLI tool to generate timestamp and git-hash based development versions

Downloads

97

Readme

dev-dump

Flexible, semver-compliant snapshot & prerelease version generator.

Generate deterministic, sortable prerelease versions for CI/CD pipelines, canary releases, feature branch deploys, and multi-stage release workflows — with zero dependencies.

Install

npm install -g dev-dump   # global
npm install -D dev-dump   # devDependency
npx dev-dump              # one-off

Quick Start

# Default: {preid}.{timestamp}.{hash}
npx dev-dump
# → 1.2.3-dev.202603171950.abc1234

# Alpha prerelease
npx dev-dump -p alpha
# → 1.2.3-alpha.202603171950.abc1234

# Auto-increment from npm registry
npx dev-dump -f "{preid}.{inc}" --from-registry
# → 1.2.3-dev.0  (next time: dev.1, dev.2, …)

# Canary release
npx dev-dump -f "canary.{hash}"
# → 1.2.3-canary.abc1234

# Feature branch snapshot
npx dev-dump -f "{branch}.{timestamp}.{hash}"
# → 1.2.3-feat-login.202603171950.abc1234

# Dry run (don't write package.json)
npx dev-dump --dry-run

# Capture for CI pipelines
VERSION=$(npx dev-dump --stdout-only)
echo "Publishing $VERSION"

Template Variables

The -f / --format flag defines the prerelease portion of the version. The base MAJOR.MINOR.PATCH is read from package.json (or overridden with --base).

| Variable | Description | Example | |---|---|---| | {preid} | Prerelease identifier (--preid) | dev, alpha, beta, rc | | {timestamp} | YYYYMMDDHHmm | 202603171950 | | {ts} | YYMMDDHHmm | 2603171950 | | {date} | YYYYMMDD | 20260317 | | {time} | HHmm | 1950 | | {hash} | Git short hash (7 chars) | abc1234 | | {hash-long} | Git full hash (40 chars) | abc1234567890… | | {inc} | Auto-increment counter (needs --from-registry) | 0, 1, 2 | | {branch} | Git branch name (sanitised) | feat-login | | {base} | MAJOR.MINOR.PATCH | 1.2.3 |

Options

| Option | Short | Default | Description | |---|---|---|---| | --preid <id> | -p | dev | Prerelease identifier | | --format <tpl> | -f | {preid}.{timestamp}.{hash} | Prerelease template | | --base <ver> | -b | from package.json | Override base version | | --from-registry | -r | false | Resolve base / {inc} from npm registry | | --tag <tag> | -t | latest | dist-tag for --from-registry | | --dry-run | -d | false | Print version without writing files | | --stdout-only | -s | false | Only output version to stdout | | --no-git-tag | | true | Don't create a git tag | | --cwd <path> | | . | Working directory | | --help | -h | | Show help | | --version | -v | | Show tool version |

Common Recipes

CI/CD Snapshot (default)

npx dev-dump
# 1.2.3-dev.202603171950.abc1234
npm publish --tag dev

Standard Prerelease Cycle

# alpha phase
npx dev-dump -p alpha -f "{preid}.{inc}" -r
# 1.2.3-alpha.0 → alpha.1 → alpha.2

# beta phase
npx dev-dump -p beta -f "{preid}.{inc}" -r
# 1.2.3-beta.0 → beta.1

# release candidate
npx dev-dump -p rc -f "{preid}.{inc}" -r
# 1.2.3-rc.0 → rc.1

# final release
npm version 1.2.3

Feature Branch Deploy

npx dev-dump -f "{branch}.{timestamp}.{hash}"
# 1.2.3-feat-login.202603171950.abc1234
npm publish --tag "$(git branch --show-current | tr '/' '-')"

Canary Release

npx dev-dump -f "canary.{hash}"
# 1.2.3-canary.abc1234
npm publish --tag canary

Override Base for Next Major

npx dev-dump -b 2.0.0 -p alpha
# 2.0.0-alpha.202603171950.abc1234

GitHub Actions Example

- name: Publish snapshot
  run: |
    VERSION=$(npx dev-dump --stdout-only)
    npm version "$VERSION" --no-git-tag-version
    npm publish --tag dev
  env:
    NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

SemVer Compliance

All generated versions are fully compliant with Semantic Versioning 2.0.0:

  • Prerelease identifiers use only [0-9A-Za-z-]
  • No leading zeros on numeric identifiers
  • Empty identifiers are automatically removed
  • Branch names and custom strings are sanitised (/ _-)
  • Versions are validated with a strict SemVer regex before output
  • Ordering is verified: timestamps naturally sort correctly, {inc} is monotonically increasing

Programmatic API

const {
  parseSemver,
  isValidSemver,
  semverCompare,
  sanitise,
  interpolate,
  buildVariables,
  resolveInc,
  resolveBaseFromRegistry,
} = require('dev-dump');

// Parse
parseSemver('1.2.3-dev.1');
// → { major: 1, minor: 2, patch: 3, prerelease: 'dev.1', build: '', base: '1.2.3' }

// Compare
semverCompare('1.0.0-alpha', '1.0.0-beta'); // → -1

// Sanitise branch names
sanitise('feature/my_branch'); // → 'feature-my-branch'

// Interpolate custom template
interpolate('{preid}.{timestamp}', { preid: 'dev', timestamp: '202603171950' });
// → 'dev.202603171950'

Zero Dependencies

This package has no runtime dependencies. It includes a built-in semver parser, comparator, and validator — everything needed in a single index.js file.

License

MIT