https://github.com/int64ago/update-notifier
update-notifier with custom scope registry
https://github.com/int64ago/update-notifier
update-notifier
Last synced: 8 months ago
JSON representation
update-notifier with custom scope registry
- Host: GitHub
- URL: https://github.com/int64ago/update-notifier
- Owner: int64ago
- License: mit
- Created: 2018-02-07T11:24:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-19T12:07:18.000Z (about 8 years ago)
- Last Synced: 2025-10-06T02:26:06.169Z (8 months ago)
- Topics: update-notifier
- Language: JavaScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# update-notifier
[![NPM version][npm-image]][npm-url]
[![Downloads][downloads-image]][npm-url]
[update-notifier][update-notifier] with custom scope registry
## Usage
No new concept, use [update-notifier][update-notifier] under the hood.
```bash
npm i @hspkg/update-notifier -S
```
```javascript
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](https://int64ago.org/)
[npm-image]: https://img.shields.io/npm/v/@hspkg/update-notifier.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@hspkg/update-notifier
[downloads-image]: https://img.shields.io/npm/dt/@hspkg/update-notifier.svg?style=flat-square
[update-notifier]: https://github.com/yeoman/update-notifier