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 🙏

© 2024 – Pkg Stats / Ryan Hefner

npmpub

v5.1.1

Published

`npm publish` on steroid

Downloads

1,200

Readme

npmpub

Build Status NPM version

npm publish on steroid

What is this?

The npm publish command is nice, but you always have to handle things before (fresh tests) and after (tag, GitHub release)... So if you want to release faster, just use this package/command!

  • Pulls in remote git commits to ensure you publish the latest commit.
  • Checks that a tag does not exist with the current version.
  • Reinstalls dependencies to ensure your project works with a fresh dependency tree.
  • Runs the tests.
  • Publishes a new version to npm.
  • Creates a git tag.
  • Pushes commits and tags to GitHub.
  • Edits the tag as a GitHub release based on the new version and corresponding changelog version (using github-release-from-changelog).

Requirements

  • npm ( 5.7 if you don't use yarn - to use npm ci)
  • yarn (optional)

In order to make use this package and the "GitHub release" feature, you will need a $GITHUB_TOKEN available as an env variable. If you want to use everything except this feature, just use the --no-release option (see below).

  • You can generate a token from GitHub interface
  • Put it in ~/.github_token
  • In your .bashrc/zshrc, export it by adding export GITHUB_TOKEN=$(cat $HOME/.github_token).

Install

$ npm install -D npmpub
# -- or --
$ yarn add --dev npmpub

Usage

Since you are probably maintaining a CHANGELOG (or you should), you already handle by hand version number (because you care about semver, don't you?).

So here is how to use this command:

  • Prepare your CHANGELOG. The best (and easy way) to do this is by preparing your changelog while you commit your features/fixes. It make the release process more easy. So when you commit an API change, a feature or a fix, add your commit message in your CHANGELOG prefixed by Removed/Changed/Added/Fixed.
  • Update your version number in your CHANGELOG. It's very easy to choose a version number:
    • If you have at least a Removed or a Changed, it's a breaking change, so increment the first number (X.y.z),
    • If you have Added something, it's a minor change, so increment the second number (x.Y.z),
    • If you just have Fixed something, it's a patch, so increment the last number (x.y.Z).
  • Update your version number in your package.json
  • Commit
  • Run npmpub so have a clean release (fresh tests + tag + GitHub release notes)

How to run npmpub?

There is two way:

$ ./node_modules/.bin/npmpub

Or you can add a npm scripts in your package.json

{
  "scripts": {
    "release": "npmpub"
  }
}

This way you can run

$ npm run release
# -- or --
$ yarn release

Options

$ ./node_modules/.bin/npmpub --help

npmpub [options]

--help          Just what you are reading.
--verbose       Get some informations.
--debug         Get all informations about process.
--skip-status   Skip git status check (⚠︎ you might release unversionned stuff).
--skip-fetch    Skip git fetch to compare remote (⚠︎ you might not be able to push).
--skip-compare  Skip git comparison with origin (⚠︎ you might not be able to push).
--skip-cleanup  Skip node_modules cleanup (⚠︎ you might miss some dependencies changes).
--skip-test     Skip test (⚠︎ USE THIS VERY CAREFULLY).
--otp           Prompt for npm's 2FA one-time-password before publishing
--public        Set access to public when publishing @scoped/package
--dry           No publish, just check that tests are ok.
--no-release    No GitHub release from changelog.

CONTRIBUTING

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.

CHANGELOG

LICENSE