publish

2018-12-07 admin

publish是什么

什么是publish,npm auto publishing of your modules

publish使用教程帮助文档

publish

Build Status

npm module to automate publishing of npm modules Useful when you want to publish every time you bump the version in your module as part of your continuos integration setup.

When running publish in your module:

  • if your module is not yet in the registry then publish will do nothing (you need to publish manually the first version of your module)
  • if your module has the same version, or lower version than the version in the registry then publish will do nothing
  • if your module has bigger version than the version in the registry then publish will perform a ‘npm publish’ of your module

Installation

npm install publish

Usage

The most common way of using publish is to have it as a posttest script in your package.json:

"scripts": {
  "test": "tap test/*.js", // tap as an example
  "posttest": "publish"
}

which means that on successful test run, publish will try to ‘npm publish’ your module.

Notice that your CI machine needs to be configured with an npm user (http://npmjs.org/doc/adduser.html) that is authorized to publish the package.

The options that you can use with publish are:

  • –on-major Publishes on major version changes.
  • –on-minor Publishes on minor version changes.
  • –on-patch Publishes on patch version changes.
  • –on-build Publishes on build version changes.
  • –test Prints the versions of the packages and whether it would publish.
  • –tag Publishes the change with the given tag. (npm defaults to ‘latest’)
  • –version Print the version of publish.
  • –help Print the help of publish.

Examples

publish --on-major --on-minor

will only publish when the local major or minor versions are higher than the remote ones

publish --on-build

will only publish when the local build version is higher than the remote one

publish

will only publish when the local version is higher than the remote one

License

MIT

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-47505.html

文章标题:publish

相关文章
esdoc-publish-markdown-plugin
esdoc-publish-markdown-plugin是什么 什么是esdoc-publish-markdown-plugin,A publish markdown plugin for ESDoc [PoC] esdoc-publi...
2019-03-17
JS设计模式之Obeserver(观察者)模式、Publish/Subscribe(发布/订阅)模式
Obeserver(观察者)模式 定义 《js设计模式》中对Observer的定义: 一个对象(称为subject)维持一系列依赖于它(观察者)的对象,将有关状态的任何变更自动通知给它们。 《设计模式:可服用面向对象软件的基础》中对Obse...
2019-03-13
publishr
publishr是什么 什么是publishr,A tool for harmonious publishing of git and npm packages. publishr官网:官网 publishr源码仓库:源码仓库 publi...
2019-03-04
npm-prepublish
npm-prepublish是什么 什么是npm-prepublish,Allows you use to use a continuous testing tool (such as Travis) to deploy to npm on...
2019-04-03
ember-publisher
ember-publisher是什么 什么是ember-publisher,This is a micro-lib designed to help unify s3 publishing for Ember and related Emb...
2019-04-02
clean-for-publish
clean-for-publish是什么 什么是clean-for-publish,A small cli utility for cleaning out your build folder before publishing node ...
2019-04-29
greenkeeper-postpublish
greenkeeper-postpublish是什么 什么是greenkeeper-postpublish,postpublish hook for announcing new versions to greenkeeper green...
2019-05-11
回到顶部