schnee effeckt und fehler Korektur
This commit is contained in:
43
node_modules/bin-version/index.d.ts
generated
vendored
Normal file
43
node_modules/bin-version/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
declare namespace binVersion {
|
||||
interface Options {
|
||||
/**
|
||||
The arguments to pass to `binary` so that it will print its version.
|
||||
|
||||
@default ['--version']
|
||||
*/
|
||||
args?: string[];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Get the version of a binary in [semver](https://github.com/npm/node-semver) format.
|
||||
|
||||
@param binary - The name of or path to the binary to get the version from.
|
||||
@returns The version of the `binary`.
|
||||
|
||||
@example
|
||||
```
|
||||
import binVersion = require('bin-version');
|
||||
|
||||
(async () => {
|
||||
// $ curl --version
|
||||
// curl 7.30.0 (x86_64-apple-darwin13.0)
|
||||
|
||||
console.log(await binVersion('curl'));
|
||||
//=> '7.30.0'
|
||||
|
||||
|
||||
// $ openssl version
|
||||
// OpenSSL 1.0.2d 9 Jul 2015
|
||||
|
||||
console.log(await binVersion('openssl', {args: ['version']}));
|
||||
//=> '1.0.2'
|
||||
})();
|
||||
```
|
||||
*/
|
||||
declare function binVersion(
|
||||
binary: string,
|
||||
options?: binVersion.Options
|
||||
): Promise<string>;
|
||||
|
||||
export = binVersion;
|
||||
22
node_modules/bin-version/index.js
generated
vendored
22
node_modules/bin-version/index.js
generated
vendored
@@ -1,17 +1,15 @@
|
||||
'use strict';
|
||||
var childProcess = require('child_process');
|
||||
var findVersions = require('find-versions');
|
||||
const execa = require('execa');
|
||||
const findVersions = require('find-versions');
|
||||
|
||||
module.exports = function (bin, cb) {
|
||||
childProcess.exec(bin + ' --version', function (err, stdout, stderr) {
|
||||
if (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
err.message = 'Couldn\'t find the `' + bin + '` binary. Make sure it\'s installed and in your $PATH';
|
||||
module.exports = (binary, options = {}) => {
|
||||
return execa(binary, options.args || ['--version'])
|
||||
.then(result => findVersions(result.stdout || result.stderr, {loose: true})[0])
|
||||
.catch(error => {
|
||||
if (error.code === 'ENOENT') {
|
||||
error.message = `Couldn't find the \`${binary}\` binary. Make sure it's installed and in your $PATH.`;
|
||||
}
|
||||
|
||||
return cb(err);
|
||||
}
|
||||
|
||||
cb(null, findVersions(stdout.trim() || stderr.trim(), {loose: true})[0]);
|
||||
});
|
||||
throw error;
|
||||
});
|
||||
};
|
||||
|
||||
20
node_modules/bin-version/license
generated
vendored
20
node_modules/bin-version/license
generated
vendored
@@ -1,21 +1,9 @@
|
||||
The MIT License (MIT)
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
72
node_modules/bin-version/package.json
generated
vendored
72
node_modules/bin-version/package.json
generated
vendored
@@ -1,36 +1,40 @@
|
||||
{
|
||||
"name": "bin-version",
|
||||
"version": "1.0.4",
|
||||
"description": "Get the version of a binary in semver format",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/bin-version",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "http://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"bin",
|
||||
"binary",
|
||||
"executable",
|
||||
"version",
|
||||
"semver",
|
||||
"semantic",
|
||||
"cli"
|
||||
],
|
||||
"dependencies": {
|
||||
"find-versions": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "0.0.4"
|
||||
}
|
||||
"name": "bin-version",
|
||||
"version": "3.1.0",
|
||||
"description": "Get the version of a binary in semver format",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/bin-version",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"bin",
|
||||
"binary",
|
||||
"executable",
|
||||
"version",
|
||||
"semver",
|
||||
"semantic",
|
||||
"cli"
|
||||
],
|
||||
"dependencies": {
|
||||
"execa": "^1.0.0",
|
||||
"find-versions": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
||||
|
||||
61
node_modules/bin-version/readme.md
generated
vendored
61
node_modules/bin-version/readme.md
generated
vendored
@@ -1,37 +1,72 @@
|
||||
# bin-version [](https://travis-ci.org/sindresorhus/bin-version)
|
||||
# bin-version [](https://travis-ci.com/sindresorhus/bin-version)
|
||||
|
||||
> Get the version of a binary in [semver](https://github.com/isaacs/node-semver) format
|
||||
> Get the version of a binary in [semver](https://github.com/npm/node-semver) format
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save bin-version
|
||||
```
|
||||
$ npm install bin-version
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```sh
|
||||
```
|
||||
$ curl --version
|
||||
curl 7.30.0 (x86_64-apple-darwin13.0)
|
||||
```
|
||||
|
||||
```js
|
||||
var binVersion = require('bin-version');
|
||||
const binVersion = require('bin-version');
|
||||
|
||||
binVersion('curl', function (err, version) {
|
||||
console.log(version);
|
||||
//=> 7.30.0
|
||||
});
|
||||
(async () => {
|
||||
console.log(await binVersion('curl'));
|
||||
//=> '7.30.0'
|
||||
})();
|
||||
```
|
||||
|
||||
```
|
||||
$ openssl version
|
||||
OpenSSL 1.0.2d 9 Jul 2015
|
||||
```
|
||||
|
||||
## CLI
|
||||
```js
|
||||
(async () => {
|
||||
console.log(await binVersion('openssl', {args: ['version']}));
|
||||
//=> '1.0.2'
|
||||
})();
|
||||
```
|
||||
|
||||
See the [find-versions](https://github.com/sindresorhus/find-versions#cli) CLI.
|
||||
## API
|
||||
|
||||
### binVersion(binary, [options])
|
||||
|
||||
Returns a `Promise<string>` with the version of the `binary`.
|
||||
|
||||
#### binary
|
||||
|
||||
Type: `string`
|
||||
|
||||
The name of or path to the binary to get the version from.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### args
|
||||
|
||||
Type: `string[]`
|
||||
Default: `['--version']`
|
||||
|
||||
The arguments to pass to `binary` so that it will print its version.
|
||||
|
||||
## Related
|
||||
|
||||
- [bin-version-cli](https://github.com/sindresorhus/bin-version-cli) - CLI for this module
|
||||
- [find-versions](https://github.com/sindresorhus/find-versions) - Find semver versions in a string
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
|
||||
Reference in New Issue
Block a user