crates-updater
Advanced tools
Comparing version
@@ -0,2 +1,42 @@ | ||
#!/usr/bin/env node | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var program = require("commander"); | ||
var CratesUpdater_1 = require("./CratesUpdater"); | ||
var _a = require('../package.json'), name = _a.name, version = _a.version, description = _a.description; | ||
program | ||
.name(name) | ||
.description(description) | ||
.option('-p, --package <package>', 'which package to check (required)') | ||
.option('-V, --package-version <version>', 'which version to check') | ||
.option('-k, --api-key <key>', 'set the API key for libraries.io (required)') | ||
.version(version, '-v, --version') | ||
.parse(process.argv); | ||
if (!program.options.length || !program.apiKey || !program.package) { | ||
program.outputHelp(); | ||
process.exit(1); | ||
} | ||
var cratesUpdater = new CratesUpdater_1.CratesUpdater(program.apiKey); | ||
if (program.package && !program.packageVersion) { | ||
cratesUpdater | ||
.getLatestVersion(program.package) | ||
.then(function (version) { return console.log(version.number); }) | ||
.catch(function (error) { | ||
console.error(error); | ||
process.exit(1); | ||
}); | ||
} | ||
else { | ||
cratesUpdater | ||
.checkForUpdate(program.package, program.packageVersion) | ||
.then(function (version) { | ||
if (version) { | ||
console.log(version); | ||
} | ||
}) | ||
.catch(function (error) { | ||
console.error(error); | ||
process.exit(1); | ||
}); | ||
} | ||
//# sourceMappingURL=cli.js.map |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./CratesUpdater")); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"author": "Florian Keller <github@floriankeller.de>", | ||
"bin": { | ||
"crates-updater": "dist/cli.js", | ||
"update-crate": "dist/cli.js", | ||
@@ -8,2 +9,4 @@ "update-crates": "dist/cli.js" | ||
"dependencies": { | ||
"commander": "2.19.0", | ||
"compare-versions": "3.4.0", | ||
"libraries.io": "1.2.2" | ||
@@ -62,3 +65,3 @@ }, | ||
}, | ||
"version": "0.0.1" | ||
"version": "0.1.0" | ||
} |
@@ -8,1 +8,26 @@ # crates-updater [](https://www.npmjs.com/package/crates-updater) [](https://dependabot.com) | ||
Run `yarn global add crates-updater` or `npm i -g crates-updater`. | ||
## Usage | ||
``` | ||
Usage: crates-updater [options] | ||
Check your Rust packages for updates. | ||
Options: | ||
-p, --package <package> which package to check (required) | ||
-V, --package-version <version> which version to check | ||
-k, --api-key <key> set the API key for libraries.io (required) | ||
-v, --version output the version number | ||
-h, --help output usage information | ||
``` | ||
## Examples | ||
```shell | ||
# returns either a newer version or nothing | ||
crates-updater -p ripgrep -V 0.9.0 -k <api key> | ||
# returns the latest version | ||
crates-updater -p ripgrep -k <api key> | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
13081
300.52%12
33.33%148
7300%33
312.5%0
-100%3
200%2
100%+ Added
+ Added
+ Added
+ Added