UNPKG

5.6 kBMarkdownView Raw
1# available-versions
2
3Fetches new versions for a given NPM package higher than given version.
4
5[![NPM][available-versions-icon]][available-versions-url]
6
7[![ci](https://github.com/bahmutov/available-versions/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/bahmutov/available-versions/actions/workflows/ci.yml)
8[![semantic-release][semantic-image] ][semantic-url]
9[![manpm](https://img.shields.io/badge/manpm-%E2%9C%93-3399ff.svg)](https://github.com/bahmutov/manpm)
10
11for Node >= 4
12
13## Install and use
14
15 npm install -g available-versions
16
17Installs several aliases, use any one you like `available`, `versions`, `vers` or `releases`
18
19What are all releases for library `lazy-ass`?
20
21 releases lazy-ass
22
23What are new releases after `1.0.0`?
24
25 releases lazy-ass@1.0.0
26 releases lazy-ass 1.0.0
27
28The module always exits with 0, even if the NPM module was not found.
29
30## Output
31
32A table with versions, timestamps and relative age
33
34```sh
35$ vers babel@6.1.15
36babel since 6.1.15
37--------------------------
38version age dist-tag
39------- ------- --------
406.1.16 a month
416.1.17 a month
426.1.18 a month
436.2.4 19 days
446.3.13 10 days stable
45```
46
47For most modules, it will also fetch release notes from GitHub, for example
48
49```sh
50$ vers manpm@1.10.0
51manpm since 1.10.0 from git+https://github.com/bahmutov/manpm.git
52------------------------------------------------------------------------------------------------------------
53version age release dist-tag
54------- -------- ------------------------------------------------------------------------------- --------
551.10.1 8 months github: parsing github url (a00ed3e7)
561.10.2 6 months node5: testing on node 4 and 5, fixed get, (0ffdc31a, closes #22)
571.10.3 6 months node: supporting older versions of node without harmony, (88ef0a4d, closes #21)
581.10.4 6 months log: removed extra console log statement (30d2da81)
591.10.5 5 months deps: upgraded a lot of deps, trying to see if #23 is still broken (2ed9051e)
601.10.6 4 months readme: fixed getting readme by downgrading simple-get, (e7e15a25, closes #24) latest
61```
62
63The comments are clipped and cleaned up to be a single line, I recommend
64using [semantic-release](https://github.com/semantic-release/semantic-release)
65to make sure the output is useful.
66
67## API
68
69You can use this module from other modules
70
71 var available = require('available-versions');
72 var query = {
73 name: 'deps-ok',
74 version: '0.1.0' // version is optional
75 };
76 available(query).then(function (result) {
77 console.log(result.name);
78 console.log(result.versions); // array of versions
79 });
80
81You can also pass second argument to keep version cleanup error messages quiet
82
83 available(query, true) ...
84
85## Supported servers
86
87Public and private NPM registries, GitHub (public) and GitLab
88(public and private) servers. For private GitLab server, you should have
89environment variable `GITLAB_AUTH_TOKEN` set with your
90[personal access token](https://gitlab.com/profile/account).
91
92```sh
93GITLAB_AUTH_TOKEN=xxxyyyy vers @org/my-module
94```
95
96I recommend using [as-a](https://github.com/bahmutov/as-a) to simplify
97using environment variables. In this case you would do something like this
98
99```sh
100as-a gitlab vers @org/my-module
101```
102
103## Debug
104
105To debug this program, run it with `DEBUG=vers` variable
106
107 DEBUG=vers releases chalk
108
109### Small print
110
111Author: Gleb Bahmutov © 2014
112
113- [@bahmutov](https://twitter.com/bahmutov)
114- [glebbahmutov.com](https://glebbahmutov.com)
115- [blog](https://glebbahmutov.com/blog)
116- [videos](https://www.youtube.com/glebbahmutov)
117- [presentations](https://slides.com/bahmutov)
118- [cypress.tips](https://cypress.tips)
119- [Cypress Tips & Tricks Newsletter](https://cypresstips.substack.com/)
120- [my Cypress courses](https://cypress.tips/courses)
121
122License: MIT - do anything with the code, but don't blame me if it does not work.
123
124Spread the word: tweet, star on github, etc.
125
126Support: if you find any problems with this module, email / tweet /
127[open issue](https://github.com/bahmutov/available-versions/issues?state=open) on Github
128
129## MIT License
130
131Copyright (c) 2014 Gleb Bahmutov
132
133Permission is hereby granted, free of charge, to any person
134obtaining a copy of this software and associated documentation
135files (the "Software"), to deal in the Software without
136restriction, including without limitation the rights to use,
137copy, modify, merge, publish, distribute, sublicense, and/or sell
138copies of the Software, and to permit persons to whom the
139Software is furnished to do so, subject to the following
140conditions:
141
142The above copyright notice and this permission notice shall be
143included in all copies or substantial portions of the Software.
144
145THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
146EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
147OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
148NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
149HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
150WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
151FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
152OTHER DEALINGS IN THE SOFTWARE.
153
154[available-versions-icon]: https://nodei.co/npm/available-versions.svg?downloads=true
155[available-versions-url]: https://npmjs.org/package/available-versions
156[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
157[semantic-url]: https://github.com/semantic-release/semantic-release