Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crates-updater

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crates-updater - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

dist/CratesUpdater.d.ts

40

dist/cli.js

@@ -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

5

package.json
{
"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 [![npm version](https://img.shields.io/npm/v/crates-updater.svg?style=flat)](https://www.npmjs.com/package/crates-updater) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=ffflorian/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>
```
dist/cli.d.tsdist/cli.d.ts

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc