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

npm-bump

v0.0.33

Published

A better `npm version major|minor|patch`

Downloads

1,015

Readme

npm-bump

A better npm version major|minor|patch

Installation

To install invoke:

npm install -g npm-bump

You now have the npm-bump binary available.

If you want to use it as a module, invoke:

npm install npm-bump --save

Rationale

The aim of this module is to keep a repository in a state where if the version value in package.json points to a stable version, it's a tagged commit that was published to npm. Since one can add Git endpoints as packages' "versions", this allows to quickly check if an installed dependency uses a pre-release or a stable version.

Usage

Once the package has been installed, it may be used from the terminal:

npm-bump releaseType

where releaseType is one of: major, minor and patch.

To use as a module, do the following:

var npmBump = require('npm-bump');
npmBump(releaseType);

You can check the version of npm-bump via:

npm-bump --version

Regardless of using the package as a binary or a module, invoking the above code will result in:

  1. Creating a new commit that increases the project version to the nearest stable one having a larger major/minor/patch than currently.
  2. Tagging the commit with a specified version.
  3. Creating a new commit with an increased patch version and the -pre suffix added.
  4. Asking the user to do a final check and proceed or rollback.

If the user goes along, the new version gets published and created commits and tags pushed to the origin remote. Otherwise, all the changes are reversed.

Until the user gives the final green light, everything happens locally and is fully reversible.

Pre-releases

If you supply releaseType other than major/minor/patch, it will be treated as a pre-release identifier and a proper pre-release version will be tagged & published. Such a version will be published with an npm tag equal to the identifier. For example, if your package is currently at version 1.0.0-pre, the following command:

npm-bump beta

will publish a version 1.0.0-beta.0 under the tag beta and bump the version to 1.0.0-beta.1-pre.

Options

You can optionally pass the remote name and the branch name to be used, in addition to a prefix to be applied to the version bump commit message. By default the remote is assumed to be origin and the branch: main.

You can also provide the access option with the public or private value to declare whether the package should be public or private. When not provided, it uses default npm behavior: scoped packages are private & unscoped ones - public.

To customize, do the following:

  1. When using from shell:
npm-bump minor --remote origin --branch main --prefix "[no-ci]" --access public

or:

npm-bump minor -r origin -b main -p "[no-ci]" ---access public

Run:

npm-bump --help

or:

npm-bump -h

to see the full information about accepted options.

  1. When using as a library:
var npmBump = require('npm-bump').custom({
    remote: 'origin',
    branch: 'main',
    prefix: '[no-ci]',
    access: 'public',
});
npmBump(minor);

Supported Node.js versions

This project aims to support all Node.js versions supported upstream with the exception of those in maintenance mode (see Release README for more details).

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using npm test.

License

Copyright (c) 2014 Michał Gołębiowski-Owczarek. Licensed under the MIT license.