1 | # available-versions
|
2 |
|
3 | Fetches 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 |
|
11 | for Node >= 4
|
12 |
|
13 | ## Install and use
|
14 |
|
15 | npm install -g available-versions
|
16 |
|
17 | Installs several aliases, use any one you like `available`, `versions`, `vers` or `releases`
|
18 |
|
19 | What are all releases for library `lazy-ass`?
|
20 |
|
21 | releases lazy-ass
|
22 |
|
23 | What are new releases after `1.0.0`?
|
24 |
|
25 | releases lazy-ass@1.0.0
|
26 | releases lazy-ass 1.0.0
|
27 |
|
28 | The module always exits with 0, even if the NPM module was not found.
|
29 |
|
30 | ## Output
|
31 |
|
32 | A table with versions, timestamps and relative age
|
33 |
|
34 | ```sh
|
35 | $ vers babel@6.1.15
|
36 | babel since 6.1.15
|
37 | --------------------------
|
38 | version age dist-tag
|
39 | ------- ------- --------
|
40 | 6.1.16 a month
|
41 | 6.1.17 a month
|
42 | 6.1.18 a month
|
43 | 6.2.4 19 days
|
44 | 6.3.13 10 days stable
|
45 | ```
|
46 |
|
47 | For most modules, it will also fetch release notes from GitHub, for example
|
48 |
|
49 | ```sh
|
50 | $ vers manpm@1.10.0
|
51 | manpm since 1.10.0 from git+https://github.com/bahmutov/manpm.git
|
52 | ------------------------------------------------------------------------------------------------------------
|
53 | version age release dist-tag
|
54 | ------- -------- ------------------------------------------------------------------------------- --------
|
55 | 1.10.1 8 months github: parsing github url (a00ed3e7)
|
56 | 1.10.2 6 months node5: testing on node 4 and 5, fixed get, (0ffdc31a, closes #22)
|
57 | 1.10.3 6 months node: supporting older versions of node without harmony, (88ef0a4d, closes #21)
|
58 | 1.10.4 6 months log: removed extra console log statement (30d2da81)
|
59 | 1.10.5 5 months deps: upgraded a lot of deps, trying to see if #23 is still broken (2ed9051e)
|
60 | 1.10.6 4 months readme: fixed getting readme by downgrading simple-get, (e7e15a25, closes #24) latest
|
61 | ```
|
62 |
|
63 | The comments are clipped and cleaned up to be a single line, I recommend
|
64 | using [semantic-release](https://github.com/semantic-release/semantic-release)
|
65 | to make sure the output is useful.
|
66 |
|
67 | ## API
|
68 |
|
69 | You 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 |
|
81 | You can also pass second argument to keep version cleanup error messages quiet
|
82 |
|
83 | available(query, true) ...
|
84 |
|
85 | ## Supported servers
|
86 |
|
87 | Public and private NPM registries, GitHub (public) and GitLab
|
88 | (public and private) servers. For private GitLab server, you should have
|
89 | environment variable `GITLAB_AUTH_TOKEN` set with your
|
90 | [personal access token](https://gitlab.com/profile/account).
|
91 |
|
92 | ```sh
|
93 | GITLAB_AUTH_TOKEN=xxxyyyy vers @org/my-module
|
94 | ```
|
95 |
|
96 | I recommend using [as-a](https://github.com/bahmutov/as-a) to simplify
|
97 | using environment variables. In this case you would do something like this
|
98 |
|
99 | ```sh
|
100 | as-a gitlab vers @org/my-module
|
101 | ```
|
102 |
|
103 | ## Debug
|
104 |
|
105 | To debug this program, run it with `DEBUG=vers` variable
|
106 |
|
107 | DEBUG=vers releases chalk
|
108 |
|
109 | ### Small print
|
110 |
|
111 | Author: 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 |
|
122 | License: MIT - do anything with the code, but don't blame me if it does not work.
|
123 |
|
124 | Spread the word: tweet, star on github, etc.
|
125 |
|
126 | Support: 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 |
|
131 | Copyright (c) 2014 Gleb Bahmutov
|
132 |
|
133 | Permission is hereby granted, free of charge, to any person
|
134 | obtaining a copy of this software and associated documentation
|
135 | files (the "Software"), to deal in the Software without
|
136 | restriction, including without limitation the rights to use,
|
137 | copy, modify, merge, publish, distribute, sublicense, and/or sell
|
138 | copies of the Software, and to permit persons to whom the
|
139 | Software is furnished to do so, subject to the following
|
140 | conditions:
|
141 |
|
142 | The above copyright notice and this permission notice shall be
|
143 | included in all copies or substantial portions of the Software.
|
144 |
|
145 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
146 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
147 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
148 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
149 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
150 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
151 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
152 | OTHER 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
|