@badisi/latest-version 2.1.0 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -17
- package/cjs/index.js +5 -5
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
📦 Get latest versions of packages.
|
|
4
4
|
|
|
5
5
|
[][npm]
|
|
6
|
-
[][npm-dl]
|
|
7
7
|
[][license]
|
|
8
8
|
|
|
9
9
|
[][ci-tests]
|
|
@@ -11,25 +11,25 @@
|
|
|
11
11
|
<!--[][deps]-->
|
|
12
12
|
<!--[][dev-deps]-->
|
|
13
13
|
|
|
14
|
-
<hr
|
|
14
|
+
<hr/>
|
|
15
15
|
|
|
16
16
|
## Features
|
|
17
17
|
|
|
18
|
-
✅ Get `latest` and `next` versions of packages *(from package registries)
|
|
19
|
-
✅ Get `wanted` version of packages *(if a version range or a tag is provided)
|
|
20
|
-
✅ Get `installed` version of packages *(if installed locally or globally)
|
|
21
|
-
✅ Check if `updates` are available
|
|
22
|
-
✅ Cache support to increase data retrieval performance
|
|
23
|
-
✅ Support public/private repositories and proxies
|
|
18
|
+
✅ Get `latest` and `next` versions of packages *(from package registries)*<br/>
|
|
19
|
+
✅ Get `wanted` version of packages *(if a version range or a tag is provided)*<br/>
|
|
20
|
+
✅ Get `installed` version of packages *(if installed locally or globally)*<br/>
|
|
21
|
+
✅ Check if `updates` are available<br/>
|
|
22
|
+
✅ Cache support to increase data retrieval performance<br/>
|
|
23
|
+
✅ Support public/private repositories and proxies<br/>
|
|
24
24
|
|
|
25
25
|
## Installation
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
|
-
|
|
28
|
+
npm install @badisi/latest-version --save
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
```sh
|
|
32
|
-
|
|
32
|
+
yarn add @badisi/latest-version
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
## Usage
|
|
@@ -164,13 +164,13 @@ See the [developer docs][developer].
|
|
|
164
164
|
|
|
165
165
|
## Contributing
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
#### > Want to Help ?
|
|
168
168
|
|
|
169
169
|
Want to file a bug, contribute some code or improve documentation ? Excellent!
|
|
170
170
|
|
|
171
171
|
But please read up first on the guidelines for [contributing][contributing], and learn about submission process, coding rules and more.
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
#### > Code of Conduct
|
|
174
174
|
|
|
175
175
|
Please read and follow the [Code of Conduct][codeofconduct] and help me keep this project open and inclusive.
|
|
176
176
|
|
|
@@ -182,8 +182,8 @@ Please read and follow the [Code of Conduct][codeofconduct] and help me keep thi
|
|
|
182
182
|
[ci-tests]: https://github.com/badisi/latest-version/actions?query=workflow:CI%20tests
|
|
183
183
|
[deps]: https://david-dm.org/badisi/latest-version
|
|
184
184
|
[dev-deps]: https://david-dm.org/badisi/latest-version?type=dev
|
|
185
|
-
[pullrequest]: https://github.com/badisi/latest-version/blob/
|
|
186
|
-
[license]: https://github.com/badisi/latest-version/blob/
|
|
187
|
-
[developer]: https://github.com/badisi/latest-version/blob/
|
|
188
|
-
[contributing]: https://github.com/badisi/latest-version/blob/
|
|
189
|
-
[codeofconduct]: https://github.com/badisi/latest-version/blob/
|
|
185
|
+
[pullrequest]: https://github.com/badisi/latest-version/blob/main/CONTRIBUTING.md#-submitting-a-pull-request-pr
|
|
186
|
+
[license]: https://github.com/badisi/latest-version/blob/main/LICENSE
|
|
187
|
+
[developer]: https://github.com/badisi/latest-version/blob/main/DEVELOPER.md
|
|
188
|
+
[contributing]: https://github.com/badisi/latest-version/blob/main/CONTRIBUTING.md
|
|
189
|
+
[codeofconduct]: https://github.com/badisi/latest-version/blob/main/CODE_OF_CONDUCT.md
|
package/cjs/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const registry_url_1 =
|
|
5
|
-
const registry_auth_token_1 =
|
|
4
|
+
const registry_url_1 = tslib_1.__importDefault(require("registry-auth-token/registry-url"));
|
|
5
|
+
const registry_auth_token_1 = tslib_1.__importDefault(require("registry-auth-token"));
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const semver_1 = require("semver");
|
|
8
8
|
const global_dirs_1 = require("global-dirs");
|
|
@@ -98,7 +98,7 @@ const getMetadataFromCache = (pkgName, options) => {
|
|
|
98
98
|
}
|
|
99
99
|
return undefined;
|
|
100
100
|
};
|
|
101
|
-
const getLatestVersions = (pkgName, tagOrRange, options) =>
|
|
101
|
+
const getLatestVersions = (pkgName, tagOrRange, options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
102
102
|
var _a, _b, _c;
|
|
103
103
|
let pkgMetadata;
|
|
104
104
|
if (pkgName.length && (options === null || options === void 0 ? void 0 : options.useCache)) {
|
|
@@ -132,7 +132,7 @@ const getInstalledVersion = (pkgName) => {
|
|
|
132
132
|
return undefined;
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
|
-
const getInfo = (pkg, options) =>
|
|
135
|
+
const getInfo = (pkg, options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
136
136
|
const i = pkg.lastIndexOf('@');
|
|
137
137
|
let pkgInfo = {
|
|
138
138
|
name: (i > 1) ? pkg.slice(0, i) : pkg,
|
|
@@ -152,7 +152,7 @@ const getInfo = (pkg, options) => (0, tslib_1.__awaiter)(void 0, void 0, void 0,
|
|
|
152
152
|
}
|
|
153
153
|
return pkgInfo;
|
|
154
154
|
});
|
|
155
|
-
const latestVersion = (arg, options) =>
|
|
155
|
+
const latestVersion = (arg, options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
156
156
|
const pkgs = [];
|
|
157
157
|
if (typeof arg === 'string') {
|
|
158
158
|
pkgs.push(arg);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@badisi/latest-version",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "Get latest versions of packages",
|
|
5
5
|
"homepage": "https://github.com/badisi/latest-version",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,5 +38,8 @@
|
|
|
38
38
|
"global-dirs": "^3.0.0",
|
|
39
39
|
"registry-auth-token": "^4.2.1",
|
|
40
40
|
"semver": "^7.3.5"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">= 12"
|
|
41
44
|
}
|
|
42
45
|
}
|