@hspkg/update-notifier

1.1.1 • Public • Published

update-notifier

NPM version Downloads

update-notifier with custom scope registry

Usage

No new concept, use update-notifier under the hood.

npm i @hspkg/update-notifier -S
const chalk = require('chalk')
const updateNotifier = require('@hspkg/update-notifier')
const pkg = require('./package.json')

const notifier = updateNotifier({
  // optional, default is package scope
  scope: '@ali',
  // optional, default is https://registry.npmjs.org
  registry: 'https://registry.npm.taobao.org',
})({ pkg })

// optional, the same as update-notifier
notifier.update && notifier.notify({
  message: `发现新版本 ${chalk.gray(notifier.update.current)} -> ${chalk.green(notifier.update.latest)}
  运行 ${chalk.cyan('cnpm i -g ') + notifier.packageName} 更新`
})

// Put your code here

Tips

The tool writes custom registry into $HOME/.config/npm whose priority is lower than $HOME/.npmrc, so users can override the custom registry in $HOME/.npmrc.

License

MIT © Cody Chan

Readme

Keywords

Package Sidebar

Install

npm i @hspkg/update-notifier

Weekly Downloads

4

Version

1.1.1

License

MIT

Unpacked Size

3.83 kB

Total Files

4

Last publish

Collaborators

  • int64ago