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-publish-release

v1.3.10

Published

Simple interface for publishing a release to npm and/or github

Downloads

20

Readme

npm-publish-release

Easy interface for automatically bumping and publishing a release to npm and/or github.

npm package node version dependency status contributions welcome

A little package that stresses simplicity. Publishes a release to git or npm by:

  1. Bumping the MAJOR / MINOR / PATCH version appropriately in package.json.
  2. (optionally) Creating a new commit for the version bump and pushing it to origin.
  3. (optionally) Publishing a git tag with the format vX.X.X, i.e. v2.4.8 to a github repository.
  4. (optionally) Publishing to npm by using npm publish.

Installation

npm-publish-release uses vinyl-fs for modifying package.json by streaming; specifically gulp-bump. Therefore gulp must be installed globally:

$ npm install --global gulp

npm-publish-release can be installed locally or globally, and includes both a node module interface and a command-line interface (CLI).

Install globally

$ npm install --global npm-publish-release   # avalable everywhere 

Install locally

$ npm install --save npm-publish-release

# optionally link the script to node_modules/npm-publish-release
# (does NOT install the module globally)
$ cd node_modules/npm-publish-release && npm link

Usage

As mentioned earlier, the key is simplicity. With no additional options, npm-publish-release will do all of the following:

  1. Bump the PATCH version in package.json.
  2. Create a new commit with the text "Bumping to version X.X.X", and push it to master
  3. Publish a tag to github.
  4. Publish a release to npm.

CLI

Assuming your code is all committed and your working copy clean, run:

$ npr # alias for npm-publish-release

npm-publish-release output

Done.

Using it programmatically

The node module follows the same format as the CLI, and uses Bluebird promises:

const publish = require('npm-publish-release');

let child = publish()
    .then(function() {
      console.log('success!');
    })
    .catch(function(err) {
      console.error('Something went wrong:', err);
    })
    .done();
    
require('node-clean-exit')([child]); // node-exit-clean is a separate project

Options

The options are the same for both the CLI (kebab-case) and the module interface (camelCase):

  • version {string} - Can be major, minor, patch, or a specific version number in the format X.X.X. If omitted, patch is assumed.

  • no-commit {boolean} - By default, a new commit is created and pushed to origin/master after the version bump and before the publish, to keep npm & github release versions in-sync. This option disables that behavior. May be useful if there is no associated git repository.

  • dest {string} - Either npm or github; omit for both.

  • quiet {boolean} - Output nothing (suppress STDOUT and STDERR).

  • verbose {boolean} - Display full stack traces for errors. Takes precedence over --quiet.

    Be careful here; any prompt for credentials will not be shown.


Note: If you are looking for something more robust, perhaps try one of these (although I have not tried them myself):

Contributing

contributions welcome

Other libraries

Other libraries that work well when used in conjunction with npm-publish-release:

License

The MIT License (MIT)

Copyright (c) 2016 Justin Helmer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.