fast-publish

An util to publish npm package conveniently.


Keywords
npm, publish, cli
License
MIT
Install
npm install fast-publish@0.0.1-alpha.3

Documentation

fast-publish

A util to publish npm package conveniently.

It will do the next steps:

  • Modify the version field of you 'package.json'.
  • Commit your changes to remote repository.
  • Tag you repository and push tags to the remote automatically.

USAGE

  • Installation
npm i -g fast-publish
# Or using yarn
yarn add global fast-publish

Using with cmd/bash

fast-publish [options]

Examples:

fast-publish

# Optionally, you can specify tag by using --dist-tag options. Example:
fast-publish --dist-tag latest

# Also, you can specify the version you want to publish by using --ver options. Example:
fast-publish --ver 0.1.0

Available options:

  • --dist-tag {string}: The dist-tag of this version.
  • --ver {string}: The version of the publishing package.
  • --ignore-git {boolean}: Ignore detecting whether the working tree is clean
  • --help -h: Display help for command
  • --version -v: Output the version number

CONFIGURATION

You can fastPublish to customize the publish behavior. eg:

{
  "fastPublish": {
    "commitTpl": "Publish Version: ${VERSION}",
    "gitTagTpl": "v${VERSION}",
    "autoTag": false,
    "pushGit": false,
    "npmClient": "npm"
  }
}

Using with nodejs

const fPub = require('fast-publish');

fPub.publish({
  distTag: 'latest', // By default, it is latest
  package: 'path/to/your/package', // By default, it is process.cwd()
  version: '0.1.0' // If no version is specified, program will ask for a answer.
});