source: node_modules/simple-update-notifier/README.md@ 62b2964

finki-main main
Last change on this file since 62b2964 was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago

Initial commit

  • Property mode set to 100644
File size: 2.4 KB
Line 
1# simple-update-notifier [![GitHub stars](https://img.shields.io/github/stars/alexbrazier/simple-update-notifier?label=Star%20Project&style=social)](https://github.com/alexbrazier/simple-update-notifier/stargazers)
2
3[![CI](https://github.com/alexbrazier/simple-update-notifier/workflows/Build%20and%20Deploy/badge.svg)](https://github.com/alexbrazier/simple-update-notifier/actions)
4[![Dependencies](https://img.shields.io/librariesio/release/npm/simple-update-notifier)](https://www.npmjs.com/package/simple-update-notifier?activeTab=dependencies)
5[![npm](https://img.shields.io/npm/v/simple-update-notifier)](https://www.npmjs.com/package/simple-update-notifier)
6[![npm bundle size](https://img.shields.io/bundlephobia/min/simple-update-notifier)](https://bundlephobia.com/result?p=simple-update-notifier)
7[![npm downloads](https://img.shields.io/npm/dw/simple-update-notifier)](https://www.npmjs.com/package/simple-update-notifier)
8[![License](https://img.shields.io/npm/l/simple-update-notifier)](./LICENSE)
9
10Simple update notifier to check for npm updates for cli applications.
11
12<img src="./.github/demo.png" alt="Demo in terminal showing an update is required">
13
14Checks for updates for an npm module and outputs to the command line if there is one available. The result is cached for the specified time so it doesn't check every time the app runs.
15
16## Install
17
18```bash
19npm install simple-update-notifier
20OR
21yarn add simple-update-notifier
22```
23
24## Usage
25
26```js
27import updateNotifier from 'simple-update-notifier';
28import packageJson from './package.json' assert { type: 'json' };
29
30updateNotifier({ pkg: packageJson });
31```
32
33### Options
34
35#### pkg
36
37Type: `object`
38
39##### name
40
41_Required_\
42Type: `string`
43
44##### version
45
46_Required_\
47Type: `string`
48
49#### updateCheckInterval
50
51Type: `number`\
52Default: `1000 * 60 * 60 * 24` _(1 day)_
53
54How often to check for updates.
55
56#### shouldNotifyInNpmScript
57
58Type: `boolean`\
59Default: `false`
60
61Allows notification to be shown when running as an npm script.
62
63#### distTag
64
65Type: `string`\
66Default: `'latest'`
67
68Which [dist-tag](https://docs.npmjs.com/adding-dist-tags-to-packages) to use to find the latest version.
69
70#### alwaysRun
71
72Type: `boolean`\
73Default: `false`
74
75When set, `updateCheckInterval` will not be respected and a check for an update will always be performed.
76
77#### debug
78
79Type: `boolean`\
80Default: `false`
81
82When set, logs explaining the decision will be output to `stderr` whenever the module opts to not print an update notification
Note: See TracBrowser for help on using the repository browser.