This commit is contained in:
Wolfgang Hottgenroth 2018-05-16 10:10:23 +02:00
commit 79abc63edd
Signed by: wn
GPG Key ID: B586EAFCDF2F65F4
597 changed files with 93351 additions and 0 deletions

10
PiAlive.conf Normal file
View File

@ -0,0 +1,10 @@
{
"brokerUrl": "mqtt://172.16.2.15:1883",
"brokerUser": "",
"brokerPass": "",
"brokerCa": "",
"topic": "dispatcher_ng/i/am/alive",
"heartbeatInterval": 5000
}

2
node_modules/@types/moment/README.md generated vendored Normal file
View File

@ -0,0 +1,2 @@
This is a stub types definition for Moment (https://github.com/moment/moment).
Moment provides its own type definitions, so you don't need @types/moment installed!

47
node_modules/@types/moment/package.json generated vendored Normal file
View File

@ -0,0 +1,47 @@
{
"_from": "@types/moment",
"_id": "@types/moment@2.13.0",
"_inBundle": false,
"_integrity": "sha1-YE69GJvDvDShVIaJQE5hoqSqyJY=",
"_location": "/@types/moment",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "@types/moment",
"name": "@types/moment",
"escapedName": "@types%2fmoment",
"scope": "@types",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#DEV:/",
"#USER"
],
"_resolved": "https://registry.npmjs.org/@types/moment/-/moment-2.13.0.tgz",
"_shasum": "604ebd189bc3bc34a1548689404e61a2a4aac896",
"_spec": "@types/moment",
"_where": "/home/wn/workspace-node/PiAlive",
"author": "",
"bugs": {
"url": "https://github.com/moment/moment/issues"
},
"bundleDependencies": false,
"dependencies": {
"moment": "*"
},
"deprecated": "This is a stub types definition for Moment (https://github.com/moment/moment). Moment provides its own type definitions, so you don't need @types/moment installed!",
"description": "Stub TypeScript definitions entry for Moment, which provides its own types definitions",
"homepage": "https://github.com/moment/moment#readme",
"license": "MIT",
"main": "",
"name": "@types/moment",
"repository": {
"type": "git",
"url": "git+https://github.com/moment/moment.git"
},
"scripts": {},
"version": "2.13.0"
}

21
node_modules/@types/node/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
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 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

16
node_modules/@types/node/README.md generated vendored Normal file
View File

@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/node`
# Summary
This package contains type definitions for Node.js (http://nodejs.org/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped.git/tree/master/types/node
Additional Details
* Last updated: Tue, 15 May 2018 21:28:51 GMT
* Dependencies: none
* Global values: Buffer, NodeJS, SlowBuffer, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, require, setImmediate, setInterval, setTimeout
# Credits
These definitions were written by Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>, Parambir Singh <https://github.com/parambirs>, Christian Vaagland Tellnes <https://github.com/tellnes>, Wilco Bakker <https://github.com/WilcoBakker>, Nicolas Voigt <https://github.com/octo-sniffle>, Chigozirim C. <https://github.com/smac89>, Flarna <https://github.com/Flarna>, Mariusz Wiktorczyk <https://github.com/mwiktorczyk>, wwwy3y3 <https://github.com/wwwy3y3>, Deividas Bakanas <https://github.com/DeividasBakanas>, Kelvin Jin <https://github.com/kjin>, Alvis HT Tang <https://github.com/alvis>, Sebastian Silbermann <https://github.com/eps1lon>, Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>, Alberto Schiabel <https://github.com/jkomyno>, Klaus Meinhardt <https://github.com/ajafff>, Huw <https://github.com/hoo29>, Nicolas Even <https://github.com/n-e>, Bruno Scheufler <https://github.com/brunoscheufler>, Mohsen Azimi <https://github.com/mohsen1>, Hoàng Văn Khải <https://github.com/KSXGitHub>, Alexander T. <https://github.com/a-tarasyuk>, Lishude <https://github.com/islishude>.

7897
node_modules/@types/node/index.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

2488
node_modules/@types/node/inspector.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

144
node_modules/@types/node/package.json generated vendored Normal file
View File

@ -0,0 +1,144 @@
{
"_from": "@types/node",
"_id": "@types/node@10.1.0",
"_inBundle": false,
"_integrity": "sha512-sELcX/cJHwRp8kn4hYSvBxKGJ+ubl3MvS8VJQe5gz/sp7CifYxsiCxIJ35wMIYyGVMgfO2AzRa8UcVReAcJRlw==",
"_location": "/@types/node",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "@types/node",
"name": "@types/node",
"escapedName": "@types%2fnode",
"scope": "@types",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#DEV:/",
"#USER"
],
"_resolved": "https://registry.npmjs.org/@types/node/-/node-10.1.0.tgz",
"_shasum": "2783ee1b6c47cbd4044f4a233976c1ac5fa9e942",
"_spec": "@types/node",
"_where": "/home/wn/workspace-node/PiAlive",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Microsoft TypeScript",
"url": "http://typescriptlang.org"
},
{
"name": "DefinitelyTyped",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped"
},
{
"name": "Parambir Singh",
"url": "https://github.com/parambirs"
},
{
"name": "Christian Vaagland Tellnes",
"url": "https://github.com/tellnes"
},
{
"name": "Wilco Bakker",
"url": "https://github.com/WilcoBakker"
},
{
"name": "Nicolas Voigt",
"url": "https://github.com/octo-sniffle"
},
{
"name": "Chigozirim C.",
"url": "https://github.com/smac89"
},
{
"name": "Flarna",
"url": "https://github.com/Flarna"
},
{
"name": "Mariusz Wiktorczyk",
"url": "https://github.com/mwiktorczyk"
},
{
"name": "wwwy3y3",
"url": "https://github.com/wwwy3y3"
},
{
"name": "Deividas Bakanas",
"url": "https://github.com/DeividasBakanas"
},
{
"name": "Kelvin Jin",
"url": "https://github.com/kjin"
},
{
"name": "Alvis HT Tang",
"url": "https://github.com/alvis"
},
{
"name": "Sebastian Silbermann",
"url": "https://github.com/eps1lon"
},
{
"name": "Hannes Magnusson",
"url": "https://github.com/Hannes-Magnusson-CK"
},
{
"name": "Alberto Schiabel",
"url": "https://github.com/jkomyno"
},
{
"name": "Klaus Meinhardt",
"url": "https://github.com/ajafff"
},
{
"name": "Huw",
"url": "https://github.com/hoo29"
},
{
"name": "Nicolas Even",
"url": "https://github.com/n-e"
},
{
"name": "Bruno Scheufler",
"url": "https://github.com/brunoscheufler"
},
{
"name": "Mohsen Azimi",
"url": "https://github.com/mohsen1"
},
{
"name": "Hoàng Văn Khải",
"url": "https://github.com/KSXGitHub"
},
{
"name": "Alexander T.",
"url": "https://github.com/a-tarasyuk"
},
{
"name": "Lishude",
"url": "https://github.com/islishude"
}
],
"dependencies": {},
"deprecated": false,
"description": "TypeScript definitions for Node.js",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped.git#readme",
"license": "MIT",
"main": "",
"name": "@types/node",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git.git"
},
"scripts": {},
"typeScriptVersion": "2.0",
"typesPublisherContentHash": "b9a6e57a599c96f9ff1bfbd55b43a19ab3014cecce163fe4a2febef277f03de2",
"version": "10.1.0"
}

18
node_modules/@types/onoff/README.md generated vendored Normal file
View File

@ -0,0 +1,18 @@
# Installation
> `npm install --save @types/onoff`
# Summary
This package contains type definitions for onoff (https://github.com/fivdi/onoff).
# Details
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/onoff
Additional Details
* Last updated: Mon, 19 Sep 2016 17:28:59 GMT
* File structure: ProperModule
* Library Dependencies: node
* Module Dependencies: none
* Global values: __ONOFF
# Credits
These definitions were written by Marcel Ernst <https://github.com/marcel-ernst>.

53
node_modules/@types/onoff/index.d.ts generated vendored Normal file
View File

@ -0,0 +1,53 @@
// Type definitions for onoff
// Project: https://github.com/fivdi/onoff
// Definitions by: Marcel Ernst <https://github.com/marcel-ernst>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
export = __ONOFF;
declare namespace __ONOFF {
var version:string;
interface GpioOptions {
debounceTimeout:number;
}
class Gpio {
constructor(gpio:number, direction:string);
constructor(gpio:number, direction:string, edge:string);
constructor(gpio:number, direction:string, edge:string, options:GpioOptions);
constructor(gpio:number, direction:string, options:GpioOptions);
gpio:number
gpioPath:string;
opts:GpioOptions;
readBuffer:Buffer;
listeners:Array<(error:Error, value:number) => void>;
valueFd:number;
read(cb:(err:Error, value:number) => void):void;
readSync():number;
write(value:number, cb:(err:Error, value:number) => void):void;
writeSync(value:number):void;
watch(cb:(error:Error, value:number) => void):void;
unwatch():void;
unwatch(cb:(error:Error, value:number) => void):void;
unwatchAll():void;
direction():string;
setDirection(value:string):void;
edge():string;
setEdge(value:string):void;
options():GpioOptions;
unexport():void;
}
}

48
node_modules/@types/onoff/package.json generated vendored Normal file
View File

@ -0,0 +1,48 @@
{
"_from": "@types/onoff",
"_id": "@types/onoff@0.0.27",
"_inBundle": false,
"_integrity": "sha1-V3fk2EWEsACiLUtfPQSZuYrlRHg=",
"_location": "/@types/onoff",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "@types/onoff",
"name": "@types/onoff",
"escapedName": "@types%2fonoff",
"scope": "@types",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#DEV:/",
"#USER"
],
"_resolved": "https://registry.npmjs.org/@types/onoff/-/onoff-0.0.27.tgz",
"_shasum": "5777e4d84584b000a22d4b5f3d0499b98ae54478",
"_spec": "@types/onoff",
"_where": "/home/wn/workspace-node/PiAlive",
"author": {
"name": "Marcel Ernst",
"email": "https://github.com/marcel-ernst"
},
"bundleDependencies": false,
"dependencies": {
"@types/node": "*"
},
"deprecated": false,
"description": "TypeScript definitions for onoff",
"license": "MIT",
"main": "",
"name": "@types/onoff",
"repository": {
"type": "git",
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
},
"scripts": {},
"typesPublisherContentHash": "3811a0e7f4189176271d66bc24c63c5fc4244f0fd80f88bb9f5ba175c766a58e",
"typings": "index.d.ts",
"version": "0.0.27"
}

27
node_modules/@types/onoff/types-metadata.json generated vendored Normal file
View File

@ -0,0 +1,27 @@
{
"authors": "Marcel Ernst <https://github.com/marcel-ernst>",
"definitionFilename": "index.d.ts",
"libraryDependencies": [
"node"
],
"moduleDependencies": [],
"libraryMajorVersion": "0",
"libraryMinorVersion": "0",
"libraryName": "onoff",
"typingsPackageName": "onoff",
"projectName": "https://github.com/fivdi/onoff",
"sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped",
"sourceBranch": "types-2.0",
"kind": "ProperModule",
"globals": [
"__ONOFF"
],
"declaredModules": [
"onoff"
],
"files": [
"index.d.ts"
],
"hasPackageJson": false,
"contentHash": "3811a0e7f4189176271d66bc24c63c5fc4244f0fd80f88bb9f5ba175c766a58e"
}

8
node_modules/argv-tools/.travis.yml generated vendored Normal file
View File

@ -0,0 +1,8 @@
language: node_js
node_js:
- 9
- 8
- 7
- 6
- 5
- 4

21
node_modules/argv-tools/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2018 Lloyd Brookes <75pound@gmail.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:
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.

11
node_modules/argv-tools/README.hbs generated vendored Normal file
View File

@ -0,0 +1,11 @@
[![view on npm](https://img.shields.io/npm/v/argv-tools.svg)](https://www.npmjs.org/package/argv-tools)
[![npm module downloads](https://img.shields.io/npm/dt/argv-tools.svg)](https://www.npmjs.org/package/argv-tools)
[![Build Status](https://travis-ci.org/75lb/argv-tools.svg?branch=master)](https://travis-ci.org/75lb/argv-tools)
[![Dependency Status](https://david-dm.org/75lb/argv-tools.svg)](https://david-dm.org/75lb/argv-tools)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)
{{>main}}
* * *
&copy; 2018 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).

144
node_modules/argv-tools/README.md generated vendored Normal file
View File

@ -0,0 +1,144 @@
[![view on npm](https://img.shields.io/npm/v/argv-tools.svg)](https://www.npmjs.org/package/argv-tools)
[![npm module downloads](https://img.shields.io/npm/dt/argv-tools.svg)](https://www.npmjs.org/package/argv-tools)
[![Build Status](https://travis-ci.org/75lb/argv-tools.svg?branch=master)](https://travis-ci.org/75lb/argv-tools)
[![Dependency Status](https://david-dm.org/75lb/argv-tools.svg)](https://david-dm.org/75lb/argv-tools)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)
<a name="module_argv-tools"></a>
## argv-tools
Some useful tools for working with `process.argv`.
**Example**
```js
const argvTools = require('argv-tools')
```
* [argv-tools](#module_argv-tools)
* [.ArgvArray](#module_argv-tools.ArgvArray)
* [.load(argv)](#module_argv-tools.ArgvArray+load)
* [.clear()](#module_argv-tools.ArgvArray+clear)
* [.expandOptionEqualsNotation()](#module_argv-tools.ArgvArray+expandOptionEqualsNotation)
* [.expandGetoptNotation()](#module_argv-tools.ArgvArray+expandGetoptNotation)
* [.hasCombinedShortOptions()](#module_argv-tools.ArgvArray+hasCombinedShortOptions) ⇒ <code>boolean</code>
* [.re](#module_argv-tools.re)
* [.expandCombinedShortArg(arg)](#module_argv-tools.expandCombinedShortArg) ⇒ <code>Array.&lt;string&gt;</code>
* [.isOptionEqualsNotation(arg)](#module_argv-tools.isOptionEqualsNotation) ⇒ <code>boolean</code>
* [.isOption(arg)](#module_argv-tools.isOption) ⇒ <code>boolean</code>
* [.isLongOption(arg)](#module_argv-tools.isLongOption) ⇒ <code>boolean</code>
* [.getOptionName(arg)](#module_argv-tools.getOptionName) ⇒ <code>string</code>
<a name="module_argv-tools.ArgvArray"></a>
### argvTools.ArgvArray
Array subclass encapsulating common operations on `process.argv`.
**Kind**: static class of [<code>argv-tools</code>](#module_argv-tools)
* [.ArgvArray](#module_argv-tools.ArgvArray)
* [.load(argv)](#module_argv-tools.ArgvArray+load)
* [.clear()](#module_argv-tools.ArgvArray+clear)
* [.expandOptionEqualsNotation()](#module_argv-tools.ArgvArray+expandOptionEqualsNotation)
* [.expandGetoptNotation()](#module_argv-tools.ArgvArray+expandGetoptNotation)
* [.hasCombinedShortOptions()](#module_argv-tools.ArgvArray+hasCombinedShortOptions) ⇒ <code>boolean</code>
<a name="module_argv-tools.ArgvArray+load"></a>
#### argvArray.load(argv)
Clears the array has loads the supplied input.
**Kind**: instance method of [<code>ArgvArray</code>](#module_argv-tools.ArgvArray)
| Param | Type | Description |
| --- | --- | --- |
| argv | <code>Array.&lt;string&gt;</code> | The argv list to load. Defaults to `process.argv`. |
<a name="module_argv-tools.ArgvArray+clear"></a>
#### argvArray.clear()
Clear the array.
**Kind**: instance method of [<code>ArgvArray</code>](#module_argv-tools.ArgvArray)
<a name="module_argv-tools.ArgvArray+expandOptionEqualsNotation"></a>
#### argvArray.expandOptionEqualsNotation()
expand ``--option=value` style args.
**Kind**: instance method of [<code>ArgvArray</code>](#module_argv-tools.ArgvArray)
<a name="module_argv-tools.ArgvArray+expandGetoptNotation"></a>
#### argvArray.expandGetoptNotation()
expand getopt-style combinedShort options.
**Kind**: instance method of [<code>ArgvArray</code>](#module_argv-tools.ArgvArray)
<a name="module_argv-tools.ArgvArray+hasCombinedShortOptions"></a>
#### argvArray.hasCombinedShortOptions() ⇒ <code>boolean</code>
Returns true if the array contains combined short options (e.g. `-ab`).
**Kind**: instance method of [<code>ArgvArray</code>](#module_argv-tools.ArgvArray)
<a name="module_argv-tools.re"></a>
### argvTools.re
Regular expressions for matching option formats.
**Kind**: static constant of [<code>argv-tools</code>](#module_argv-tools)
<a name="module_argv-tools.expandCombinedShortArg"></a>
### argvTools.expandCombinedShortArg(arg) ⇒ <code>Array.&lt;string&gt;</code>
Expand a combined short option.
**Kind**: static method of [<code>argv-tools</code>](#module_argv-tools)
| Param | Type | Description |
| --- | --- | --- |
| arg | <code>string</code> | the string to expand, e.g. `-ab` |
<a name="module_argv-tools.isOptionEqualsNotation"></a>
### argvTools.isOptionEqualsNotation(arg) ⇒ <code>boolean</code>
Returns true if the supplied arg matches `--option=value` notation.
**Kind**: static method of [<code>argv-tools</code>](#module_argv-tools)
| Param | Type | Description |
| --- | --- | --- |
| arg | <code>string</code> | the arg to test, e.g. `--one=something` |
<a name="module_argv-tools.isOption"></a>
### argvTools.isOption(arg) ⇒ <code>boolean</code>
Returns true if the supplied arg is in either long (`--one`) or short (`-o`) format.
**Kind**: static method of [<code>argv-tools</code>](#module_argv-tools)
| Param | Type | Description |
| --- | --- | --- |
| arg | <code>string</code> | the arg to test, e.g. `--one` |
<a name="module_argv-tools.isLongOption"></a>
### argvTools.isLongOption(arg) ⇒ <code>boolean</code>
Returns true if the supplied arg is in long (`--one`) format.
**Kind**: static method of [<code>argv-tools</code>](#module_argv-tools)
| Param | Type | Description |
| --- | --- | --- |
| arg | <code>string</code> | the arg to test, e.g. `--one` |
<a name="module_argv-tools.getOptionName"></a>
### argvTools.getOptionName(arg) ⇒ <code>string</code>
Returns the name from a long, short or `--options=value` arg.
**Kind**: static method of [<code>argv-tools</code>](#module_argv-tools)
| Param | Type | Description |
| --- | --- | --- |
| arg | <code>string</code> | the arg to inspect, e.g. `--one` |
* * *
&copy; 2018 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).

163
node_modules/argv-tools/index.js generated vendored Normal file
View File

@ -0,0 +1,163 @@
'use strict'
/**
* Some useful tools for working with `process.argv`.
*
* @module argv-tools
* @typicalName argvTools
* @example
* const argvTools = require('argv-tools')
*/
/**
* Regular expressions for matching option formats.
* @static
*/
const re = {
short: /^-([^\d-])$/,
long: /^--(\S+)/,
combinedShort: /^-[^\d-]{2,}$/,
optEquals: /^(--\S+?)=(.*)/
}
/**
* Array subclass encapsulating common operations on `process.argv`.
* @static
*/
class ArgvArray extends Array {
/**
* Clears the array has loads the supplied input.
* @param {string[]} argv - The argv list to load. Defaults to `process.argv`.
*/
load (argv) {
const arrayify = require('array-back')
this.clear()
if (argv && argv !== process.argv) {
argv = arrayify(argv)
} else {
/* if no argv supplied, assume we are parsing process.argv */
argv = process.argv.slice(0)
argv.splice(0, 2)
}
argv.forEach(arg => this.push(String(arg)))
}
/**
* Clear the array.
*/
clear () {
this.length = 0
}
/**
* expand ``--option=value` style args.
*/
expandOptionEqualsNotation () {
if (this.some(arg => re.optEquals.test(arg))) {
const expandedArgs = []
this.forEach(arg => {
const matches = arg.match(re.optEquals)
if (matches) {
expandedArgs.push(matches[1], matches[2])
} else {
expandedArgs.push(arg)
}
})
this.clear()
this.load(expandedArgs)
}
}
/**
* expand getopt-style combinedShort options.
*/
expandGetoptNotation () {
if (this.hasCombinedShortOptions()) {
const findReplace = require('find-replace')
findReplace(this, re.combinedShort, expandCombinedShortArg)
}
}
/**
* Returns true if the array contains combined short options (e.g. `-ab`).
* @returns {boolean}
*/
hasCombinedShortOptions () {
return this.some(arg => re.combinedShort.test(arg))
}
static from (argv) {
const result = new this()
result.load(argv)
return result
}
}
/**
* Expand a combined short option.
* @param {string} - the string to expand, e.g. `-ab`
* @returns {string[]}
* @static
*/
function expandCombinedShortArg (arg) {
/* remove initial hypen */
arg = arg.slice(1)
return arg.split('').map(letter => '-' + letter)
}
/**
* Returns true if the supplied arg matches `--option=value` notation.
* @param {string} - the arg to test, e.g. `--one=something`
* @returns {boolean}
* @static
*/
function isOptionEqualsNotation (arg) {
return re.optEquals.test(arg)
}
/**
* Returns true if the supplied arg is in either long (`--one`) or short (`-o`) format.
* @param {string} - the arg to test, e.g. `--one`
* @returns {boolean}
* @static
*/
function isOption (arg) {
return (re.short.test(arg) || re.long.test(arg)) && !re.optEquals.test(arg)
}
/**
* Returns true if the supplied arg is in long (`--one`) format.
* @param {string} - the arg to test, e.g. `--one`
* @returns {boolean}
* @static
*/
function isLongOption (arg) {
return re.long.test(arg) && !isOptionEqualsNotation(arg)
}
/**
* Returns the name from a long, short or `--options=value` arg.
* @param {string} - the arg to inspect, e.g. `--one`
* @returns {string}
* @static
*/
function getOptionName (arg) {
if (re.short.test(arg)) {
return arg.match(re.short)[1]
} else if (isLongOption(arg)) {
return arg.match(re.long)[1]
} else if (isOptionEqualsNotation(arg)) {
return arg.match(re.optEquals)[1].replace(/^--/, '')
} else {
return null
}
}
exports.expandCombinedShortArg = expandCombinedShortArg
exports.re = re
exports.ArgvArray = ArgvArray
exports.getOptionName = getOptionName
exports.isOption = isOption
exports.isLongOption = isLongOption
exports.isOptionEqualsNotation = isOptionEqualsNotation
exports.isValue = arg => !(isOption(arg) || re.combinedShort.test(arg) || re.optEquals.test(arg))

71
node_modules/argv-tools/package.json generated vendored Normal file
View File

@ -0,0 +1,71 @@
{
"_from": "argv-tools@^0.1.1",
"_id": "argv-tools@0.1.1",
"_inBundle": false,
"_integrity": "sha512-Cc0dBvx4dvrjjKpyDA6w8RlNAw8Su30NvZbWl/Tv9ZALEVlLVkWQiHMi84Q0xNfpVuSaiQbYkdmWK8g1PLGhKw==",
"_location": "/argv-tools",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "argv-tools@^0.1.1",
"name": "argv-tools",
"escapedName": "argv-tools",
"rawSpec": "^0.1.1",
"saveSpec": null,
"fetchSpec": "^0.1.1"
},
"_requiredBy": [
"/command-line-args"
],
"_resolved": "https://registry.npmjs.org/argv-tools/-/argv-tools-0.1.1.tgz",
"_shasum": "588283f3393ada47141440b12981cd41bf6b7032",
"_spec": "argv-tools@^0.1.1",
"_where": "/home/wn/workspace-node/PiAlive/node_modules/command-line-args",
"author": {
"name": "Lloyd Brookes",
"email": "75pound@gmail.com"
},
"bugs": {
"url": "https://github.com/75lb/argv-tools/issues"
},
"bundleDependencies": false,
"dependencies": {
"array-back": "^2.0.0",
"find-replace": "^2.0.1"
},
"deprecated": false,
"description": "[![view on npm](https://img.shields.io/npm/v/argv-tools.svg)](https://www.npmjs.org/package/argv-tools) [![npm module downloads](https://img.shields.io/npm/dt/argv-tools.svg)](https://www.npmjs.org/package/argv-tools) [![Build Status](https://travis-ci.org/75lb/argv-tools.svg?branch=master)](https://travis-ci.org/75lb/argv-tools) [![Dependency Status](https://david-dm.org/75lb/argv-tools.svg)](https://david-dm.org/75lb/argv-tools) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)",
"devDependencies": {
"jsdoc-to-markdown": "^3.0.3",
"test-runner": "^0.5.0-1"
},
"engines": {
"node": ">=4.0.0"
},
"homepage": "https://github.com/75lb/argv-tools#readme",
"keywords": [
"argv",
"parse",
"argument",
"args",
"option",
"options",
"parser",
"parsing",
"cli",
"command",
"line"
],
"license": "MIT",
"name": "argv-tools",
"repository": {
"type": "git",
"url": "git+https://github.com/75lb/argv-tools.git"
},
"scripts": {
"docs": "jsdoc2md --template README.hbs index.js > README.md",
"test": "test-runner test.js"
},
"version": "0.1.1"
}

78
node_modules/argv-tools/test.js generated vendored Normal file
View File

@ -0,0 +1,78 @@
'use strict'
const TestRunner = require('test-runner')
const a = require('assert')
const ArgvArray = require('./').ArgvArray
const argvTools = require('./')
const runner = new TestRunner()
runner.test('argvArray.expandOptionEqualsNotation()', function () {
const argv = new ArgvArray()
argv.load([ '--one=1', '--two', '2', '--three=3', '4' ])
argv.expandOptionEqualsNotation()
a.deepEqual(argv, [
'--one', '1', '--two', '2', '--three', '3', '4'
])
})
runner.test('argvArray.expandOptionEqualsNotation() 2', function () {
const argv = new ArgvArray()
argv.load([ '--one=tree' ])
argv.expandOptionEqualsNotation()
a.deepEqual(argv, [ '--one', 'tree' ])
})
runner.test('argvArray.expandGetoptNotation()', function () {
const argv = new ArgvArray()
argv.load([ '-abc' ])
argv.expandGetoptNotation()
a.deepEqual(argv.slice(), [
'-a', '-b', '-c'
])
})
runner.test('argvArray.expandGetoptNotation() with values', function () {
const argv = new ArgvArray()
argv.load([ '-abc', '1', '-a', '2', '-bc' ])
argv.expandGetoptNotation()
a.deepEqual(argv, [
'-a', '-b', '-c', '1', '-a', '2', '-b', '-c'
])
})
runner.test('argvArray.hasCombinedShortOptions()', function () {
const argv = new ArgvArray()
argv.load([ '-abc', '1', '-a', '2' ])
a.strictEqual(argv.hasCombinedShortOptions(), true)
argv.load([ '1', '-a', '2' ])
a.strictEqual(argv.hasCombinedShortOptions(), false)
argv.load([ '1', '-ab', '2' ])
a.strictEqual(argv.hasCombinedShortOptions(), true)
})
runner.test('argvTools.isOption()', function () {
a.strictEqual(argvTools.isOption('--yeah'), true)
a.strictEqual(argvTools.isOption('--one-two'), true)
a.strictEqual(argvTools.isOption('в--yeah'), false)
a.strictEqual(argvTools.isOption('-y'), true)
a.strictEqual(argvTools.isOption('--option=value'), false)
a.strictEqual(argvTools.isOption('-asd'), false)
})
runner.test('argvTools.isLongOption()', function () {
a.strictEqual(argvTools.isLongOption('--yeah'), true)
a.strictEqual(argvTools.isLongOption('--one-two'), true)
a.strictEqual(argvTools.isLongOption('в--yeah'), false)
a.strictEqual(argvTools.isLongOption('-y'), false)
a.strictEqual(argvTools.isLongOption('--option=value'), false)
a.strictEqual(argvTools.isLongOption('-asd'), false)
})
runner.test('argvTools.getOptionName()', function () {
a.strictEqual(argvTools.getOptionName('--yeah'), 'yeah')
a.strictEqual(argvTools.getOptionName('--one-two'), 'one-two')
a.strictEqual(argvTools.getOptionName('в--yeah'), null)
a.strictEqual(argvTools.getOptionName('-y'), 'y')
a.strictEqual(argvTools.getOptionName('--option=value'), 'option')
a.strictEqual(argvTools.getOptionName('-asd'), null)
})

1
node_modules/array-back/.coveralls.yml generated vendored Normal file
View File

@ -0,0 +1 @@
repo_token: S6p2PWnbIwJPOfO3XRVsAM5z4tNMh9hgr

2
node_modules/array-back/.npmignore generated vendored Normal file
View File

@ -0,0 +1,2 @@
tmp
out

7
node_modules/array-back/.travis.yml generated vendored Normal file
View File

@ -0,0 +1,7 @@
language: node_js
node_js:
- 8
- 7
- 6
- 5
- 4

21
node_modules/array-back/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015-17 Lloyd Brookes <75pound@gmail.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:
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.

12
node_modules/array-back/README.hbs generated vendored Normal file
View File

@ -0,0 +1,12 @@
[![view on npm](https://img.shields.io/npm/v/array-back.svg)](https://www.npmjs.org/package/array-back)
[![npm module downloads](https://img.shields.io/npm/dt/array-back.svg)](https://www.npmjs.org/package/array-back)
[![Build Status](https://travis-ci.org/75lb/array-back.svg?branch=master)](https://travis-ci.org/75lb/array-back)
[![Coverage Status](https://coveralls.io/repos/github/75lb/array-back/badge.svg?branch=master)](https://coveralls.io/github/75lb/array-back?branch=master)
[![Dependency Status](https://david-dm.org/75lb/array-back.svg)](https://david-dm.org/75lb/array-back)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)
{{>main}}
* * *
&copy; 2015-17 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).

52
node_modules/array-back/README.md generated vendored Normal file
View File

@ -0,0 +1,52 @@
[![view on npm](https://img.shields.io/npm/v/array-back.svg)](https://www.npmjs.org/package/array-back)
[![npm module downloads](https://img.shields.io/npm/dt/array-back.svg)](https://www.npmjs.org/package/array-back)
[![Build Status](https://travis-ci.org/75lb/array-back.svg?branch=master)](https://travis-ci.org/75lb/array-back)
[![Coverage Status](https://coveralls.io/repos/github/75lb/array-back/badge.svg?branch=master)](https://coveralls.io/github/75lb/array-back?branch=master)
[![Dependency Status](https://david-dm.org/75lb/array-back.svg)](https://david-dm.org/75lb/array-back)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)
<a name="module_array-back"></a>
## array-back
**Example**
```js
const arrayify = require('array-back')
```
<a name="exp_module_array-back--arrayify"></a>
### arrayify(input) ⇒ <code>Array</code>
Takes any input and guarantees an array back.
- converts array-like objects (e.g. `arguments`) to a real array
- converts `undefined` to an empty array
- converts any another other, singular value (including `null`) into an array containing that value
- ignores input which is already an array
**Kind**: Exported function
| Param | Type | Description |
| --- | --- | --- |
| input | <code>\*</code> | the input value to convert to an array |
**Example**
```js
> a.arrayify(undefined)
[]
> a.arrayify(null)
[ null ]
> a.arrayify(0)
[ 0 ]
> a.arrayify([ 1, 2 ])
[ 1, 2 ]
> function f(){ return a.arrayify(arguments); }
> f(1,2,3)
[ 1, 2, 3 ]
```
* * *
&copy; 2015-17 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).

1
node_modules/array-back/coverage/coverage.json generated vendored Normal file
View File

@ -0,0 +1 @@
{"/Users/lloydb/Documents/75lb/array-back/test.js":{"path":"/Users/lloydb/Documents/75lb/array-back/test.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1},"b":{},"f":{"1":1,"2":1,"3":1},"fnMap":{"1":{"name":"(anonymous_1)","line":8,"loc":{"start":{"line":8,"column":44},"end":{"line":8,"column":56}}},"2":{"name":"(anonymous_2)","line":14,"loc":{"start":{"line":14,"column":26},"end":{"line":14,"column":38}}},"3":{"name":"func","line":20,"loc":{"start":{"line":20,"column":2},"end":{"line":20,"column":19}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":41}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":30}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":27}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":31}},"5":{"start":{"line":8,"column":0},"end":{"line":12,"column":2}},"6":{"start":{"line":9,"column":2},"end":{"line":9,"column":23}},"7":{"start":{"line":10,"column":2},"end":{"line":10,"column":30}},"8":{"start":{"line":11,"column":2},"end":{"line":11,"column":28}},"9":{"start":{"line":14,"column":0},"end":{"line":24,"column":2}},"10":{"start":{"line":15,"column":2},"end":{"line":15,"column":44}},"11":{"start":{"line":16,"column":2},"end":{"line":16,"column":45}},"12":{"start":{"line":17,"column":2},"end":{"line":17,"column":39}},"13":{"start":{"line":18,"column":2},"end":{"line":18,"column":49}},"14":{"start":{"line":20,"column":2},"end":{"line":22,"column":3}},"15":{"start":{"line":21,"column":4},"end":{"line":21,"column":55}},"16":{"start":{"line":23,"column":2},"end":{"line":23,"column":15}}},"branchMap":{}},"/Users/lloydb/Documents/75lb/array-back/index.js":{"path":"/Users/lloydb/Documents/75lb/array-back/index.js","s":{"1":1,"2":1,"3":6,"4":6,"5":2,"6":4,"7":1,"8":3,"9":1,"10":2},"b":{"1":[2,4],"2":[1,3],"3":[1,2]},"f":{"1":6},"fnMap":{"1":{"name":"arrayify","line":36,"loc":{"start":{"line":36,"column":0},"end":{"line":36,"column":26}}}},"statementMap":{"1":{"start":{"line":6,"column":0},"end":{"line":6,"column":25}},"2":{"start":{"line":36,"column":0},"end":{"line":49,"column":1}},"3":{"start":{"line":37,"column":2},"end":{"line":37,"column":30}},"4":{"start":{"line":38,"column":2},"end":{"line":48,"column":3}},"5":{"start":{"line":39,"column":4},"end":{"line":39,"column":16}},"6":{"start":{"line":41,"column":4},"end":{"line":47,"column":5}},"7":{"start":{"line":42,"column":6},"end":{"line":42,"column":15}},"8":{"start":{"line":43,"column":11},"end":{"line":47,"column":5}},"9":{"start":{"line":44,"column":6},"end":{"line":44,"column":46}},"10":{"start":{"line":46,"column":6},"end":{"line":46,"column":22}}},"branchMap":{"1":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":2},"end":{"line":38,"column":2}},{"start":{"line":38,"column":2},"end":{"line":38,"column":2}}]},"2":{"line":41,"type":"if","locations":[{"start":{"line":41,"column":4},"end":{"line":41,"column":4}},{"start":{"line":41,"column":4},"end":{"line":41,"column":4}}]},"3":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":11},"end":{"line":43,"column":11}},{"start":{"line":43,"column":11},"end":{"line":43,"column":11}}]}}}}

View File

@ -0,0 +1,106 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for array-back/</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../index.html">all files</a> array-back/
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>26/26</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>6/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>26/26</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="index.js"><a href="index.js.html">index.js</a></td>
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="10" class="abs high">10/10</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">6/6</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="10" class="abs high">10/10</td>
</tr>
<tr>
<td class="file high" data-value="test.js"><a href="test.js.html">test.js</a></td>
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="16" class="abs high">16/16</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="16" class="abs high">16/16</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Jun 24 2017 21:40:08 GMT+0100 (BST)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,212 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for array-back/index.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../index.html">all files</a> / <a href="index.html">array-back/</a> index.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>10/10</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>6/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>10/10</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/**
* @module array-back
* @example
* const arrayify = require('array-back')
*/
module.exports = arrayify
&nbsp;
/**
* Takes any input and guarantees an array back.
*
* - converts array-like objects (e.g. `arguments`) to a real array
* - converts `undefined` to an empty array
* - converts any another other, singular value (including `null`) into an array containing that value
* - ignores input which is already an array
*
* @param {*} - the input value to convert to an array
* @returns {Array}
* @alias module:array-back
* @example
* &gt; a.arrayify(undefined)
* []
*
* &gt; a.arrayify(null)
* [ null ]
*
* &gt; a.arrayify(0)
* [ 0 ]
*
* &gt; a.arrayify([ 1, 2 ])
* [ 1, 2 ]
*
* &gt; function f(){ return a.arrayify(arguments); }
* &gt; f(1,2,3)
* [ 1, 2, 3 ]
*/
function arrayify (input) {
const t = require('typical')
if (Array.isArray(input)) {
return input
} else {
if (input === undefined) {
return []
} else if (t.isArrayLike(input)) {
return Array.prototype.slice.call(input)
} else {
return [ input ]
}
}
}
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Jun 24 2017 21:40:08 GMT+0100 (BST)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1,137 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for array-back/test.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../index.html">all files</a> / <a href="index.html">array-back/</a> test.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>16/16</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>16/16</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">'use strict'
const TestRunner = require('test-runner')
const arrayify = require('./')
const a = require('assert')
&nbsp;
const runner = new TestRunner()
&nbsp;
runner.test('if already array, do nothing', function () {
const arr = [ 1,2,3 ]
const result = arrayify(arr)
a.strictEqual(arr, result)
})
&nbsp;
runner.test('arrayify()', function () {
a.deepStrictEqual(arrayify(undefined), [])
a.deepStrictEqual(arrayify(null), [ null ])
a.deepStrictEqual(arrayify(0), [ 0 ])
a.deepStrictEqual(arrayify([ 1, 2 ]), [ 1, 2 ])
&nbsp;
function func () {
a.deepStrictEqual(arrayify(arguments), [ 1, 2, 3 ])
}
func(1, 2, 3)
})
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Jun 24 2017 21:40:08 GMT+0100 (BST)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>

213
node_modules/array-back/coverage/lcov-report/base.css generated vendored Normal file
View File

@ -0,0 +1,213 @@
body, html {
margin:0; padding: 0;
height: 100%;
}
body {
font-family: Helvetica Neue, Helvetica, Arial;
font-size: 14px;
color:#333;
}
.small { font-size: 12px; }
*, *:after, *:before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
h1 { font-size: 20px; margin: 0;}
h2 { font-size: 14px; }
pre {
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
margin: 0;
padding: 0;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
}
a { color:#0074D9; text-decoration:none; }
a:hover { text-decoration:underline; }
.strong { font-weight: bold; }
.space-top1 { padding: 10px 0 0 0; }
.pad2y { padding: 20px 0; }
.pad1y { padding: 10px 0; }
.pad2x { padding: 0 20px; }
.pad2 { padding: 20px; }
.pad1 { padding: 10px; }
.space-left2 { padding-left:55px; }
.space-right2 { padding-right:20px; }
.center { text-align:center; }
.clearfix { display:block; }
.clearfix:after {
content:'';
display:block;
height:0;
clear:both;
visibility:hidden;
}
.fl { float: left; }
@media only screen and (max-width:640px) {
.col3 { width:100%; max-width:100%; }
.hide-mobile { display:none!important; }
}
.quiet {
color: #7f7f7f;
color: rgba(0,0,0,0.5);
}
.quiet a { opacity: 0.7; }
.fraction {
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
font-size: 10px;
color: #555;
background: #E8E8E8;
padding: 4px 5px;
border-radius: 3px;
vertical-align: middle;
}
div.path a:link, div.path a:visited { color: #333; }
table.coverage {
border-collapse: collapse;
margin: 10px 0 0 0;
padding: 0;
}
table.coverage td {
margin: 0;
padding: 0;
vertical-align: top;
}
table.coverage td.line-count {
text-align: right;
padding: 0 5px 0 20px;
}
table.coverage td.line-coverage {
text-align: right;
padding-right: 10px;
min-width:20px;
}
table.coverage td span.cline-any {
display: inline-block;
padding: 0 5px;
width: 100%;
}
.missing-if-branch {
display: inline-block;
margin-right: 5px;
border-radius: 3px;
position: relative;
padding: 0 4px;
background: #333;
color: yellow;
}
.skip-if-branch {
display: none;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: #ccc;
color: white;
}
.missing-if-branch .typ, .skip-if-branch .typ {
color: inherit !important;
}
.coverage-summary {
border-collapse: collapse;
width: 100%;
}
.coverage-summary tr { border-bottom: 1px solid #bbb; }
.keyline-all { border: 1px solid #ddd; }
.coverage-summary td, .coverage-summary th { padding: 10px; }
.coverage-summary tbody { border: 1px solid #bbb; }
.coverage-summary td { border-right: 1px solid #bbb; }
.coverage-summary td:last-child { border-right: none; }
.coverage-summary th {
text-align: left;
font-weight: normal;
white-space: nowrap;
}
.coverage-summary th.file { border-right: none !important; }
.coverage-summary th.pct { }
.coverage-summary th.pic,
.coverage-summary th.abs,
.coverage-summary td.pct,
.coverage-summary td.abs { text-align: right; }
.coverage-summary td.file { white-space: nowrap; }
.coverage-summary td.pic { min-width: 120px !important; }
.coverage-summary tfoot td { }
.coverage-summary .sorter {
height: 10px;
width: 7px;
display: inline-block;
margin-left: 0.5em;
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
}
.coverage-summary .sorted .sorter {
background-position: 0 -20px;
}
.coverage-summary .sorted-desc .sorter {
background-position: 0 -10px;
}
.status-line { height: 10px; }
/* dark red */
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
.low .chart { border:1px solid #C21F39 }
/* medium red */
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
/* light red */
.low, .cline-no { background:#FCE1E5 }
/* light green */
.high, .cline-yes { background:rgb(230,245,208) }
/* medium green */
.cstat-yes { background:rgb(161,215,106) }
/* dark green */
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
.high .chart { border:1px solid rgb(77,146,33) }
/* dark yellow (gold) */
.medium .chart { border:1px solid #f9cd0b; }
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
/* light yellow */
.medium { background: #fff4c2; }
/* light gray */
span.cline-neutral { background: #eaeaea; }
.cbranch-no { background: yellow !important; color: #111; }
.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }
.cover-fill, .cover-empty {
display:inline-block;
height: 12px;
}
.chart {
line-height: 0;
}
.cover-empty {
background: white;
}
.cover-full {
border-right: none !important;
}
pre.prettyprint {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.com { color: #999 !important; }
.ignore-none { color: #999; font-weight: normal; }
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -48px;
}
.footer, .push {
height: 48px;
}

View File

@ -0,0 +1,93 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for All files</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
/
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>26/26</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>6/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>26/26</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="array-back/"><a href="array-back/index.html">array-back/</a></td>
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="26" class="abs high">26/26</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">6/6</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="4" class="abs high">4/4</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="26" class="abs high">26/26</td>
</tr>
</tbody>
</table>
</div><div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Jun 24 2017 21:40:08 GMT+0100 (BST)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="sorter.js"></script>
</body>
</html>

View File

@ -0,0 +1 @@
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

158
node_modules/array-back/coverage/lcov-report/sorter.js generated vendored Normal file
View File

@ -0,0 +1,158 @@
var addSorting = (function () {
"use strict";
var cols,
currentSort = {
index: 0,
desc: false
};
// returns the summary table element
function getTable() { return document.querySelector('.coverage-summary'); }
// returns the thead element of the summary table
function getTableHeader() { return getTable().querySelector('thead tr'); }
// returns the tbody element of the summary table
function getTableBody() { return getTable().querySelector('tbody'); }
// returns the th element for nth column
function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
// loads all columns
function loadColumns() {
var colNodes = getTableHeader().querySelectorAll('th'),
colNode,
cols = [],
col,
i;
for (i = 0; i < colNodes.length; i += 1) {
colNode = colNodes[i];
col = {
key: colNode.getAttribute('data-col'),
sortable: !colNode.getAttribute('data-nosort'),
type: colNode.getAttribute('data-type') || 'string'
};
cols.push(col);
if (col.sortable) {
col.defaultDescSort = col.type === 'number';
colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
}
}
return cols;
}
// attaches a data attribute to every tr element with an object
// of data values keyed by column name
function loadRowData(tableRow) {
var tableCols = tableRow.querySelectorAll('td'),
colNode,
col,
data = {},
i,
val;
for (i = 0; i < tableCols.length; i += 1) {
colNode = tableCols[i];
col = cols[i];
val = colNode.getAttribute('data-value');
if (col.type === 'number') {
val = Number(val);
}
data[col.key] = val;
}
return data;
}
// loads all row data
function loadData() {
var rows = getTableBody().querySelectorAll('tr'),
i;
for (i = 0; i < rows.length; i += 1) {
rows[i].data = loadRowData(rows[i]);
}
}
// sorts the table using the data for the ith column
function sortByIndex(index, desc) {
var key = cols[index].key,
sorter = function (a, b) {
a = a.data[key];
b = b.data[key];
return a < b ? -1 : a > b ? 1 : 0;
},
finalSorter = sorter,
tableBody = document.querySelector('.coverage-summary tbody'),
rowNodes = tableBody.querySelectorAll('tr'),
rows = [],
i;
if (desc) {
finalSorter = function (a, b) {
return -1 * sorter(a, b);
};
}
for (i = 0; i < rowNodes.length; i += 1) {
rows.push(rowNodes[i]);
tableBody.removeChild(rowNodes[i]);
}
rows.sort(finalSorter);
for (i = 0; i < rows.length; i += 1) {
tableBody.appendChild(rows[i]);
}
}
// removes sort indicators for current column being sorted
function removeSortIndicators() {
var col = getNthColumn(currentSort.index),
cls = col.className;
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
col.className = cls;
}
// adds sort indicators for current column being sorted
function addSortIndicators() {
getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
}
// adds event listeners for all sorter widgets
function enableUI() {
var i,
el,
ithSorter = function ithSorter(i) {
var col = cols[i];
return function () {
var desc = col.defaultDescSort;
if (currentSort.index === i) {
desc = !currentSort.desc;
}
sortByIndex(i, desc);
removeSortIndicators();
currentSort.index = i;
currentSort.desc = desc;
addSortIndicators();
};
};
for (i =0 ; i < cols.length; i += 1) {
if (cols[i].sortable) {
// add the click event handler on the th so users
// dont have to click on those tiny arrows
el = getNthColumn(i).querySelector('.sorter').parentElement;
if (el.addEventListener) {
el.addEventListener('click', ithSorter(i));
} else {
el.attachEvent('onclick', ithSorter(i));
}
}
}
}
// adds sorting functionality to the UI
return function () {
if (!getTable()) {
return;
}
cols = loadColumns();
loadData(cols);
addSortIndicators();
enableUI();
};
})();
window.addEventListener('load', addSorting);

58
node_modules/array-back/coverage/lcov.info generated vendored Normal file
View File

@ -0,0 +1,58 @@
TN:
SF:/Users/lloydb/Documents/75lb/array-back/test.js
FN:8,(anonymous_1)
FN:14,(anonymous_2)
FN:20,func
FNF:3
FNH:3
FNDA:1,(anonymous_1)
FNDA:1,(anonymous_2)
FNDA:1,func
DA:2,1
DA:3,1
DA:4,1
DA:6,1
DA:8,1
DA:9,1
DA:10,1
DA:11,1
DA:14,1
DA:15,1
DA:16,1
DA:17,1
DA:18,1
DA:20,1
DA:21,1
DA:23,1
LF:16
LH:16
BRF:0
BRH:0
end_of_record
TN:
SF:/Users/lloydb/Documents/75lb/array-back/index.js
FN:36,arrayify
FNF:1
FNH:1
FNDA:6,arrayify
DA:6,1
DA:36,1
DA:37,6
DA:38,6
DA:39,2
DA:41,4
DA:42,1
DA:43,3
DA:44,1
DA:46,2
LF:10
LH:10
BRDA:38,1,0,2
BRDA:38,1,1,4
BRDA:41,2,0,1
BRDA:41,2,1,3
BRDA:43,3,0,1
BRDA:43,3,1,2
BRF:6
BRH:6
end_of_record

49
node_modules/array-back/index.js generated vendored Normal file
View File

@ -0,0 +1,49 @@
/**
* @module array-back
* @example
* const arrayify = require('array-back')
*/
module.exports = arrayify
/**
* Takes any input and guarantees an array back.
*
* - converts array-like objects (e.g. `arguments`) to a real array
* - converts `undefined` to an empty array
* - converts any another other, singular value (including `null`) into an array containing that value
* - ignores input which is already an array
*
* @param {*} - the input value to convert to an array
* @returns {Array}
* @alias module:array-back
* @example
* > a.arrayify(undefined)
* []
*
* > a.arrayify(null)
* [ null ]
*
* > a.arrayify(0)
* [ 0 ]
*
* > a.arrayify([ 1, 2 ])
* [ 1, 2 ]
*
* > function f(){ return a.arrayify(arguments); }
* > f(1,2,3)
* [ 1, 2, 3 ]
*/
function arrayify (input) {
const t = require('typical')
if (Array.isArray(input)) {
return input
} else {
if (input === undefined) {
return []
} else if (t.isArrayLike(input)) {
return Array.prototype.slice.call(input)
} else {
return [ input ]
}
}
}

69
node_modules/array-back/package.json generated vendored Normal file
View File

@ -0,0 +1,69 @@
{
"_from": "array-back@^2.0.0",
"_id": "array-back@2.0.0",
"_inBundle": false,
"_integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==",
"_location": "/array-back",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "array-back@^2.0.0",
"name": "array-back",
"escapedName": "array-back",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/argv-tools",
"/command-line-args",
"/find-replace",
"/test-value"
],
"_resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz",
"_shasum": "6877471d51ecc9c9bfa6136fb6c7d5fe69748022",
"_spec": "array-back@^2.0.0",
"_where": "/home/wn/workspace-node/PiAlive/node_modules/command-line-args",
"author": {
"name": "Lloyd Brookes",
"email": "75pound@gmail.com"
},
"bugs": {
"url": "https://github.com/75lb/array-back/issues"
},
"bundleDependencies": false,
"dependencies": {
"typical": "^2.6.1"
},
"deprecated": false,
"description": "Guarantees an array back",
"devDependencies": {
"coveralls": "^2.13.1",
"jsdoc-to-markdown": "^3.0.0",
"test-runner": "^0.4.0"
},
"engines": {
"node": ">=4"
},
"homepage": "https://github.com/75lb/array-back#readme",
"keywords": [
"to",
"convert",
"return",
"array",
"arrayify"
],
"license": "MIT",
"name": "array-back",
"repository": {
"type": "git",
"url": "git+https://github.com/75lb/array-back.git"
},
"scripts": {
"cover": "istanbul cover ./node_modules/.bin/test-runner test.js && cat coverage/lcov.info | ./node_modules/.bin/coveralls; echo",
"docs": "jsdoc2md -t README.hbs index.js > README.md; echo",
"test": "test-runner test.js"
},
"version": "2.0.0"
}

24
node_modules/array-back/test.js generated vendored Normal file
View File

@ -0,0 +1,24 @@
'use strict'
const TestRunner = require('test-runner')
const arrayify = require('./')
const a = require('assert')
const runner = new TestRunner()
runner.test('if already array, do nothing', function () {
const arr = [ 1,2,3 ]
const result = arrayify(arr)
a.strictEqual(arr, result)
})
runner.test('arrayify()', function () {
a.deepStrictEqual(arrayify(undefined), [])
a.deepStrictEqual(arrayify(null), [ null ])
a.deepStrictEqual(arrayify(0), [ 0 ])
a.deepStrictEqual(arrayify([ 1, 2 ]), [ 1, 2 ])
function func () {
a.deepStrictEqual(arrayify(arguments), [ 1, 2, 3 ])
}
func(1, 2, 3)
})

911
node_modules/array-back/yarn.lock generated vendored Normal file
View File

@ -0,0 +1,911 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
acorn-jsx@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b"
dependencies:
acorn "^3.0.4"
acorn@^3.0.4, acorn@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"
amdefine@>=0.0.4:
version "1.0.1"
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
ansi-escape-sequences@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/ansi-escape-sequences/-/ansi-escape-sequences-3.0.0.tgz#1c18394b6af9b76ff9a63509fa497669fd2ce53e"
dependencies:
array-back "^1.0.3"
ansi-regex@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
ansi-styles@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
app-usage-stats@^0.5.0:
version "0.5.1"
resolved "https://registry.yarnpkg.com/app-usage-stats/-/app-usage-stats-0.5.1.tgz#6547c5db9bab0aa5f5b2c560eacc8af20d0ab13b"
dependencies:
array-back "^1.0.4"
home-path "^1.0.3"
test-value "^2.1.0"
usage-stats "^0.9.0"
argparse@^1.0.7:
version "1.0.9"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
dependencies:
sprintf-js "~1.0.2"
array-back@^1.0.2, array-back@^1.0.3, array-back@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/array-back/-/array-back-1.0.4.tgz#644ba7f095f7ffcf7c43b5f0dc39d3c1f03c063b"
dependencies:
typical "^2.6.0"
asn1@~0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86"
assert-plus@1.0.0, assert-plus@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
assert-plus@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234"
async@~0.2.6:
version "0.2.10"
resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1"
asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
aws-sign2@~0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f"
aws4@^1.2.1:
version "1.6.0"
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e"
balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
bcrypt-pbkdf@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d"
dependencies:
tweetnacl "^0.14.3"
bluebird@~3.4.6:
version "3.4.7"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3"
boom@2.x.x:
version "2.10.1"
resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f"
dependencies:
hoek "2.x.x"
brace-expansion@^1.1.7:
version "1.1.8"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292"
dependencies:
balanced-match "^1.0.0"
concat-map "0.0.1"
cache-point@^0.4.0, cache-point@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/cache-point/-/cache-point-0.4.0.tgz#2797f68055970757c87e89b464978e74e11047b0"
dependencies:
array-back "^1.0.4"
fs-then-native "^2.0.0"
mkdirp "~0.5.1"
caseless@~0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7"
catharsis@~0.8.8:
version "0.8.8"
resolved "https://registry.yarnpkg.com/catharsis/-/catharsis-0.8.8.tgz#693479f43aac549d806bd73e924cd0d944951a06"
dependencies:
underscore-contrib "~0.3.0"
chalk@^1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
dependencies:
ansi-styles "^2.2.1"
escape-string-regexp "^1.0.2"
has-ansi "^2.0.0"
strip-ansi "^3.0.0"
supports-color "^2.0.0"
collect-all@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/collect-all/-/collect-all-1.0.3.tgz#1abcc20448b58a1447487fcf34130e9512b0acf8"
dependencies:
stream-connect "^1.0.2"
stream-via "^1.0.4"
combined-stream@^1.0.5, combined-stream@~1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009"
dependencies:
delayed-stream "~1.0.0"
command-line-args@^4.0.1, command-line-args@^4.0.6:
version "4.0.6"
resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-4.0.6.tgz#0ff87a1dd159890dcaeb2a005abdae71e55059fc"
dependencies:
array-back "^1.0.4"
find-replace "^1.0.3"
typical "^2.6.1"
command-line-tool@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/command-line-tool/-/command-line-tool-0.7.0.tgz#ca80792ae2069cf7caa562c0cbc2cd11811122a0"
dependencies:
ansi-escape-sequences "^3.0.0"
array-back "^1.0.4"
command-line-args "^4.0.1"
command-line-usage "^4.0.0"
typical "^2.6.0"
command-line-usage@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/command-line-usage/-/command-line-usage-4.0.0.tgz#816b32788b58f9feba44d1e6dac60fcaeb29b5ea"
dependencies:
ansi-escape-sequences "^3.0.0"
array-back "^1.0.4"
table-layout "^0.4.0"
typical "^2.6.0"
commander@^2.9.0:
version "2.10.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.10.0.tgz#e1f5d3245de246d1a5ca04702fa1ad1bd7e405fe"
dependencies:
graceful-readlink ">= 1.0.0"
common-sequence@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/common-sequence/-/common-sequence-1.0.2.tgz#30e07f3f8f6f7f9b3dee854f20b2d39eee086de8"
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
config-master@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/config-master/-/config-master-3.1.0.tgz#667663590505a283bf26a484d68489d74c5485da"
dependencies:
walk-back "^2.0.1"
coveralls@^2.13.1:
version "2.13.1"
resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-2.13.1.tgz#d70bb9acc1835ec4f063ff9dac5423c17b11f178"
dependencies:
js-yaml "3.6.1"
lcov-parse "0.0.10"
log-driver "1.2.5"
minimist "1.2.0"
request "2.79.0"
cryptiles@2.x.x:
version "2.0.5"
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8"
dependencies:
boom "2.x.x"
dashdash@^1.12.0:
version "1.14.1"
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
dependencies:
assert-plus "^1.0.0"
deep-extend@~0.4.1:
version "0.4.2"
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f"
defer-promise@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/defer-promise/-/defer-promise-1.0.1.tgz#1ca6ffeddbcef1715dd7aae25c7616f9ae22932f"
delayed-stream@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
dmd@^3.0.0:
version "3.0.6"
resolved "https://registry.yarnpkg.com/dmd/-/dmd-3.0.6.tgz#94c0e0fb88d1cb6b82837595053de7919c753c25"
dependencies:
array-back "^1.0.4"
cache-point "^0.4.0"
common-sequence "^1.0.2"
file-set "^1.1.1"
handlebars "3.0.3"
marked "^0.3.6"
object-get "^2.1.0"
reduce-flatten "^1.0.1"
reduce-unique "^1.0.0"
reduce-without "^1.0.1"
test-value "^2.1.0"
walk-back "^3.0.0"
ecc-jsbn@~0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505"
dependencies:
jsbn "~0.1.0"
escape-string-regexp@^1.0.2, escape-string-regexp@~1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
espree@~3.1.7:
version "3.1.7"
resolved "https://registry.yarnpkg.com/espree/-/espree-3.1.7.tgz#fd5deec76a97a5120a9cd3a7cb1177a0923b11d2"
dependencies:
acorn "^3.3.0"
acorn-jsx "^3.0.0"
esprima@^2.6.0:
version "2.7.3"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581"
extend@~3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444"
extsprintf@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550"
feature-detect-es6@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/feature-detect-es6/-/feature-detect-es6-1.3.1.tgz#f888736af9cb0c91f55663bfa4762eb96ee7047f"
dependencies:
array-back "^1.0.3"
file-set@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/file-set/-/file-set-1.1.1.tgz#d3ec70c080ec8f18f204ba1de106780c9056926b"
dependencies:
array-back "^1.0.3"
glob "^7.1.0"
find-replace@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-1.0.3.tgz#b88e7364d2d9c959559f388c66670d6130441fa0"
dependencies:
array-back "^1.0.4"
test-value "^2.1.0"
forever-agent@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
form-data@~2.1.1:
version "2.1.4"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1"
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.5"
mime-types "^2.1.12"
fs-then-native@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/fs-then-native/-/fs-then-native-2.0.0.tgz#19a124d94d90c22c8e045f2e8dd6ebea36d48c67"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
generate-function@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74"
generate-object-property@^1.1.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0"
dependencies:
is-property "^1.0.0"
getpass@^0.1.1:
version "0.1.7"
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
dependencies:
assert-plus "^1.0.0"
glob@^7.1.0:
version "7.1.2"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"
graceful-fs@^4.1.9:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
"graceful-readlink@>= 1.0.0":
version "1.0.1"
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
handlebars@3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-3.0.3.tgz#0e09651a2f0fb3c949160583710d551f92e6d2ad"
dependencies:
optimist "^0.6.1"
source-map "^0.1.40"
optionalDependencies:
uglify-js "~2.3"
har-validator@~2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d"
dependencies:
chalk "^1.1.1"
commander "^2.9.0"
is-my-json-valid "^2.12.4"
pinkie-promise "^2.0.0"
has-ansi@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
dependencies:
ansi-regex "^2.0.0"
hawk@~3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4"
dependencies:
boom "2.x.x"
cryptiles "2.x.x"
hoek "2.x.x"
sntp "1.x.x"
hoek@2.x.x:
version "2.16.3"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"
home-path@^1.0.3, home-path@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/home-path/-/home-path-1.0.5.tgz#788b29815b12d53bacf575648476e6f9041d133f"
http-signature@~1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf"
dependencies:
assert-plus "^0.2.0"
jsprim "^1.2.2"
sshpk "^1.7.0"
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
dependencies:
once "^1.3.0"
wrappy "1"
inherits@2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
is-my-json-valid@^2.12.4:
version "2.16.0"
resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693"
dependencies:
generate-function "^2.0.0"
generate-object-property "^1.1.0"
jsonpointer "^4.0.0"
xtend "^4.0.0"
is-property@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84"
is-typedarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
isstream@~0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
js-yaml@3.6.1:
version "3.6.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30"
dependencies:
argparse "^1.0.7"
esprima "^2.6.0"
js2xmlparser@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/js2xmlparser/-/js2xmlparser-1.0.0.tgz#5a170f2e8d6476ce45405e04823242513782fe30"
jsbn@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
jsdoc-75lb@^3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/jsdoc-75lb/-/jsdoc-75lb-3.6.0.tgz#a807119528b4009ccbcab49b7522f63fec6cd0bd"
dependencies:
bluebird "~3.4.6"
catharsis "~0.8.8"
escape-string-regexp "~1.0.5"
espree "~3.1.7"
js2xmlparser "~1.0.0"
klaw "~1.3.0"
marked "~0.3.6"
mkdirp "~0.5.1"
requizzle "~0.2.1"
strip-json-comments "~2.0.1"
taffydb "2.6.2"
underscore "~1.8.3"
jsdoc-api@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/jsdoc-api/-/jsdoc-api-3.0.0.tgz#0d52700235f865bd4a8bad5ebc1efb562fc8ad2a"
dependencies:
array-back "^1.0.4"
cache-point "~0.4.0"
collect-all "^1.0.2"
file-set "^1.1.1"
fs-then-native "^2.0.0"
jsdoc-75lb "^3.6.0"
object-to-spawn-args "^1.1.0"
temp-path "^1.0.0"
walk-back "^2.0.1"
jsdoc-parse@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/jsdoc-parse/-/jsdoc-parse-3.0.0.tgz#271531d88f19df2520b1632a7f6c989441a87fde"
dependencies:
array-back "^1.0.4"
lodash.omit "^4.5.0"
lodash.pick "^4.4.0"
reduce-extract "^1.0.0"
sort-array "^1.1.1"
test-value "^2.1.0"
jsdoc-to-markdown@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/jsdoc-to-markdown/-/jsdoc-to-markdown-3.0.0.tgz#cc8a94f1f412ac1da4bac1657475b0975ee8161a"
dependencies:
array-back "^1.0.4"
command-line-tool "^0.7.0"
config-master "^3.0.0"
dmd "^3.0.0"
jsdoc-api "^3.0.0"
jsdoc-parse "^3.0.0"
jsdoc2md-stats "^2.0.0"
walk-back "^2.0.1"
jsdoc2md-stats@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/jsdoc2md-stats/-/jsdoc2md-stats-2.0.1.tgz#bd8343734cfe69ea8050a17931251293f0d9047b"
dependencies:
app-usage-stats "^0.5.0"
json-schema@0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
json-stringify-safe@~5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
jsonpointer@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9"
jsprim@^1.2.2:
version "1.4.0"
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918"
dependencies:
assert-plus "1.0.0"
extsprintf "1.0.2"
json-schema "0.2.3"
verror "1.3.6"
klaw@~1.3.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439"
optionalDependencies:
graceful-fs "^4.1.9"
lcov-parse@0.0.10:
version "0.0.10"
resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3"
lodash.omit@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.omit/-/lodash.omit-4.5.0.tgz#6eb19ae5a1ee1dd9df0b969e66ce0b7fa30b5e60"
lodash.padend@^4.6.1:
version "4.6.1"
resolved "https://registry.yarnpkg.com/lodash.padend/-/lodash.padend-4.6.1.tgz#53ccba047d06e158d311f45da625f4e49e6f166e"
lodash.pick@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3"
log-driver@1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.5.tgz#7ae4ec257302fd790d557cb10c97100d857b0056"
marked@^0.3.6, marked@~0.3.6:
version "0.3.6"
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.6.tgz#b2c6c618fccece4ef86c4fc6cb8a7cbf5aeda8d7"
mime-db@~1.27.0:
version "1.27.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1"
mime-types@^2.1.12, mime-types@~2.1.7:
version "2.1.15"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed"
dependencies:
mime-db "~1.27.0"
minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
dependencies:
brace-expansion "^1.1.7"
minimist@0.0.8, minimist@~0.0.1:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
minimist@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
mkdirp2@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/mkdirp2/-/mkdirp2-1.0.3.tgz#cc8dd8265f1f06e2d8f5b10b6e52f4e050bed21b"
mkdirp@~0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
dependencies:
minimist "0.0.8"
oauth-sign@~0.8.1:
version "0.8.2"
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
object-get@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/object-get/-/object-get-2.1.0.tgz#722bbdb60039efa47cad3c6dc2ce51a85c02c5ae"
object-to-spawn-args@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/object-to-spawn-args/-/object-to-spawn-args-1.1.1.tgz#77da8827f073d011c9e1b173f895781470246785"
once@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
dependencies:
wrappy "1"
optimist@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
dependencies:
minimist "~0.0.1"
wordwrap "~0.0.2"
optimist@~0.3.5:
version "0.3.7"
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.3.7.tgz#c90941ad59e4273328923074d2cf2e7cbc6ec0d9"
dependencies:
wordwrap "~0.0.2"
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
pinkie-promise@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
dependencies:
pinkie "^2.0.0"
pinkie@^2.0.0:
version "2.0.4"
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
qs@~6.3.0:
version "6.3.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c"
reduce-extract@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/reduce-extract/-/reduce-extract-1.0.0.tgz#67f2385beda65061b5f5f4312662e8b080ca1525"
dependencies:
test-value "^1.0.1"
reduce-flatten@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-1.0.1.tgz#258c78efd153ddf93cb561237f61184f3696e327"
reduce-unique@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/reduce-unique/-/reduce-unique-1.0.0.tgz#7e586bcf87a4e32b6d7abd8277fad6cdec9f4803"
reduce-without@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/reduce-without/-/reduce-without-1.0.1.tgz#68ad0ead11855c9a37d4e8256c15bbf87972fc8c"
dependencies:
test-value "^2.0.0"
req-then@^0.6.1:
version "0.6.2"
resolved "https://registry.yarnpkg.com/req-then/-/req-then-0.6.2.tgz#7f9e6ebbcab327adc9280aa92b3698d3fc1c5b0d"
dependencies:
array-back "^1.0.4"
defer-promise "^1.0.1"
lodash.pick "^4.4.0"
stream-read-all "^0.1.0"
typical "^2.6.1"
request@2.79.0:
version "2.79.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de"
dependencies:
aws-sign2 "~0.6.0"
aws4 "^1.2.1"
caseless "~0.11.0"
combined-stream "~1.0.5"
extend "~3.0.0"
forever-agent "~0.6.1"
form-data "~2.1.1"
har-validator "~2.0.6"
hawk "~3.1.3"
http-signature "~1.1.0"
is-typedarray "~1.0.0"
isstream "~0.1.2"
json-stringify-safe "~5.0.1"
mime-types "~2.1.7"
oauth-sign "~0.8.1"
qs "~6.3.0"
stringstream "~0.0.4"
tough-cookie "~2.3.0"
tunnel-agent "~0.4.1"
uuid "^3.0.0"
requizzle@~0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/requizzle/-/requizzle-0.2.1.tgz#6943c3530c4d9a7e46f1cddd51c158fc670cdbde"
dependencies:
underscore "~1.6.0"
sntp@1.x.x:
version "1.0.9"
resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198"
dependencies:
hoek "2.x.x"
sort-array@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/sort-array/-/sort-array-1.1.2.tgz#b88986053c0170a7f9de63f18a49ec79c24c3e64"
dependencies:
array-back "^1.0.4"
object-get "^2.1.0"
typical "^2.6.0"
source-map@^0.1.40, source-map@~0.1.7:
version "0.1.43"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346"
dependencies:
amdefine ">=0.0.4"
sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
sshpk@^1.7.0:
version "1.13.1"
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3"
dependencies:
asn1 "~0.2.3"
assert-plus "^1.0.0"
dashdash "^1.12.0"
getpass "^0.1.1"
optionalDependencies:
bcrypt-pbkdf "^1.0.0"
ecc-jsbn "~0.1.1"
jsbn "~0.1.0"
tweetnacl "~0.14.0"
stream-connect@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/stream-connect/-/stream-connect-1.0.2.tgz#18bc81f2edb35b8b5d9a8009200a985314428a97"
dependencies:
array-back "^1.0.2"
stream-read-all@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/stream-read-all/-/stream-read-all-0.1.0.tgz#04fd4498d4f29717f5b7f316354425cf318c6385"
dependencies:
test-runner "^0.4.0"
stream-via@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/stream-via/-/stream-via-1.0.4.tgz#8dccbb0ac909328eb8bc8e2a4bd3934afdaf606c"
stringstream@~0.0.4:
version "0.0.5"
resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878"
strip-ansi@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
dependencies:
ansi-regex "^2.0.0"
strip-json-comments@~2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
supports-color@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
table-layout@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-0.4.0.tgz#c70ff0455d9add63b91f7c15a77926295c0e0e7d"
dependencies:
array-back "^1.0.4"
deep-extend "~0.4.1"
lodash.padend "^4.6.1"
typical "^2.6.0"
wordwrapjs "^2.0.0"
taffydb@2.6.2:
version "2.6.2"
resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.6.2.tgz#7cbcb64b5a141b6a2efc2c5d2c67b4e150b2a268"
temp-path@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/temp-path/-/temp-path-1.0.0.tgz#24b1543973ab442896d9ad367dd9cbdbfafe918b"
test-runner@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/test-runner/-/test-runner-0.4.0.tgz#41426f9b3dfff4bcda2cb23f3b7df73d67d6b8a2"
dependencies:
ansi-escape-sequences "^3.0.0"
array-back "^1.0.4"
command-line-args "^4.0.6"
command-line-usage "^4.0.0"
file-set "^1.1.1"
reduce-flatten "^1.0.1"
test-value@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/test-value/-/test-value-1.1.0.tgz#a09136f72ec043d27c893707c2b159bfad7de93f"
dependencies:
array-back "^1.0.2"
typical "^2.4.2"
test-value@^2.0.0, test-value@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/test-value/-/test-value-2.1.0.tgz#11da6ff670f3471a73b625ca4f3fdcf7bb748291"
dependencies:
array-back "^1.0.3"
typical "^2.6.0"
tough-cookie@~2.3.0:
version "2.3.2"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a"
dependencies:
punycode "^1.4.1"
tunnel-agent@~0.4.1:
version "0.4.3"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb"
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
version "0.14.5"
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
typical@^2.4.2, typical@^2.6.0, typical@^2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.1.tgz#5c080e5d661cbbe38259d2e70a3c7253e873881d"
uglify-js@~2.3:
version "2.3.6"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.3.6.tgz#fa0984770b428b7a9b2a8058f46355d14fef211a"
dependencies:
async "~0.2.6"
optimist "~0.3.5"
source-map "~0.1.7"
underscore-contrib@~0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/underscore-contrib/-/underscore-contrib-0.3.0.tgz#665b66c24783f8fa2b18c9f8cbb0e2c7d48c26c7"
dependencies:
underscore "1.6.0"
underscore@1.6.0, underscore@~1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8"
underscore@~1.8.3:
version "1.8.3"
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022"
usage-stats@^0.9.0:
version "0.9.1"
resolved "https://registry.yarnpkg.com/usage-stats/-/usage-stats-0.9.1.tgz#3b34997dbef1e151f48a118a93a5c595e1d4269a"
dependencies:
array-back "^1.0.4"
home-path "^1.0.5"
mkdirp2 "^1.0.2"
req-then "^0.6.1"
typical "^2.6.0"
uuid "^3.0.1"
uuid@^3.0.0, uuid@^3.0.1:
version "3.1.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04"
verror@1.3.6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c"
dependencies:
extsprintf "1.0.2"
walk-back@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/walk-back/-/walk-back-2.0.1.tgz#554e2a9d874fac47a8cb006bf44c2f0c4998a0a4"
walk-back@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/walk-back/-/walk-back-3.0.0.tgz#2358787a35da91032dad5e92f80b12370d8795c5"
wordwrap@~0.0.2:
version "0.0.3"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
wordwrapjs@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/wordwrapjs/-/wordwrapjs-2.0.0.tgz#ab55f695e6118da93858fdd70c053d1c5e01ac20"
dependencies:
array-back "^1.0.3"
feature-detect-es6 "^1.3.1"
reduce-flatten "^1.0.1"
typical "^2.6.0"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
xtend@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"

98
node_modules/bindings/README.md generated vendored Normal file
View File

@ -0,0 +1,98 @@
node-bindings
=============
### Helper module for loading your native module's .node file
This is a helper module for authors of Node.js native addon modules.
It is basically the "swiss army knife" of `require()`ing your native module's
`.node` file.
Throughout the course of Node's native addon history, addons have ended up being
compiled in a variety of different places, depending on which build tool and which
version of node was used. To make matters worse, now the _gyp_ build tool can
produce either a _Release_ or _Debug_ build, each being built into different
locations.
This module checks _all_ the possible locations that a native addon would be built
at, and returns the first one that loads successfully.
Installation
------------
Install with `npm`:
``` bash
$ npm install bindings
```
Or add it to the `"dependencies"` section of your _package.json_ file.
Example
-------
`require()`ing the proper bindings file for the current node version, platform
and architecture is as simple as:
``` js
var bindings = require('bindings')('binding.node')
// Use your bindings defined in your C files
bindings.your_c_function()
```
Nice Error Output
-----------------
When the `.node` file could not be loaded, `node-bindings` throws an Error with
a nice error message telling you exactly what was tried. You can also check the
`err.tries` Array property.
```
Error: Could not load the bindings file. Tried:
→ /Users/nrajlich/ref/build/binding.node
→ /Users/nrajlich/ref/build/Debug/binding.node
→ /Users/nrajlich/ref/build/Release/binding.node
→ /Users/nrajlich/ref/out/Debug/binding.node
→ /Users/nrajlich/ref/Debug/binding.node
→ /Users/nrajlich/ref/out/Release/binding.node
→ /Users/nrajlich/ref/Release/binding.node
→ /Users/nrajlich/ref/build/default/binding.node
→ /Users/nrajlich/ref/compiled/0.8.2/darwin/x64/binding.node
at bindings (/Users/nrajlich/ref/node_modules/bindings/bindings.js:84:13)
at Object.<anonymous> (/Users/nrajlich/ref/lib/ref.js:5:47)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
...
```
The searching for the `.node` file will originate from the first directory in which has a `package.json` file is found.
License
-------
(The MIT License)
Copyright (c) 2012 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
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 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.

171
node_modules/bindings/bindings.js generated vendored Normal file
View File

@ -0,0 +1,171 @@
/**
* Module dependencies.
*/
var fs = require('fs')
, path = require('path')
, join = path.join
, dirname = path.dirname
, exists = ((fs.accessSync && function (path) { try { fs.accessSync(path); } catch (e) { return false; } return true; })
|| fs.existsSync || path.existsSync)
, defaults = {
arrow: process.env.NODE_BINDINGS_ARROW || ' → '
, compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled'
, platform: process.platform
, arch: process.arch
, version: process.versions.node
, bindings: 'bindings.node'
, try: [
// node-gyp's linked version in the "build" dir
[ 'module_root', 'build', 'bindings' ]
// node-waf and gyp_addon (a.k.a node-gyp)
, [ 'module_root', 'build', 'Debug', 'bindings' ]
, [ 'module_root', 'build', 'Release', 'bindings' ]
// Debug files, for development (legacy behavior, remove for node v0.9)
, [ 'module_root', 'out', 'Debug', 'bindings' ]
, [ 'module_root', 'Debug', 'bindings' ]
// Release files, but manually compiled (legacy behavior, remove for node v0.9)
, [ 'module_root', 'out', 'Release', 'bindings' ]
, [ 'module_root', 'Release', 'bindings' ]
// Legacy from node-waf, node <= 0.4.x
, [ 'module_root', 'build', 'default', 'bindings' ]
// Production "Release" buildtype binary (meh...)
, [ 'module_root', 'compiled', 'version', 'platform', 'arch', 'bindings' ]
]
}
/**
* The main `bindings()` function loads the compiled bindings for a given module.
* It uses V8's Error API to determine the parent filename that this function is
* being invoked from, which is then used to find the root directory.
*/
function bindings (opts) {
// Argument surgery
if (typeof opts == 'string') {
opts = { bindings: opts }
} else if (!opts) {
opts = {}
}
// maps `defaults` onto `opts` object
Object.keys(defaults).map(function(i) {
if (!(i in opts)) opts[i] = defaults[i];
});
// Get the module root
if (!opts.module_root) {
opts.module_root = exports.getRoot(exports.getFileName())
}
// Ensure the given bindings name ends with .node
if (path.extname(opts.bindings) != '.node') {
opts.bindings += '.node'
}
var tries = []
, i = 0
, l = opts.try.length
, n
, b
, err
for (; i<l; i++) {
n = join.apply(null, opts.try[i].map(function (p) {
return opts[p] || p
}))
tries.push(n)
try {
b = opts.path ? require.resolve(n) : require(n)
if (!opts.path) {
b.path = n
}
return b
} catch (e) {
if (!/not find/i.test(e.message)) {
throw e
}
}
}
err = new Error('Could not locate the bindings file. Tried:\n'
+ tries.map(function (a) { return opts.arrow + a }).join('\n'))
err.tries = tries
throw err
}
module.exports = exports = bindings
/**
* Gets the filename of the JavaScript file that invokes this function.
* Used to help find the root directory of a module.
* Optionally accepts an filename argument to skip when searching for the invoking filename
*/
exports.getFileName = function getFileName (calling_file) {
var origPST = Error.prepareStackTrace
, origSTL = Error.stackTraceLimit
, dummy = {}
, fileName
Error.stackTraceLimit = 10
Error.prepareStackTrace = function (e, st) {
for (var i=0, l=st.length; i<l; i++) {
fileName = st[i].getFileName()
if (fileName !== __filename) {
if (calling_file) {
if (fileName !== calling_file) {
return
}
} else {
return
}
}
}
}
// run the 'prepareStackTrace' function above
Error.captureStackTrace(dummy)
dummy.stack
// cleanup
Error.prepareStackTrace = origPST
Error.stackTraceLimit = origSTL
return fileName
}
/**
* Gets the root directory of a module, given an arbitrary filename
* somewhere in the module tree. The "root directory" is the directory
* containing the `package.json` file.
*
* In: /home/nate/node-native-module/lib/index.js
* Out: /home/nate/node-native-module
*/
exports.getRoot = function getRoot (file) {
var dir = dirname(file)
, prev
while (true) {
if (dir === '.') {
// Avoids an infinite loop in rare cases, like the REPL
dir = process.cwd()
}
if (exists(join(dir, 'package.json')) || exists(join(dir, 'node_modules'))) {
// Found the 'package.json' file or 'node_modules' dir; we're done
return dir
}
if (prev === dir) {
// Got to the top
throw new Error('Could not find module root given file: "' + file
+ '". Do you have a `package.json` file? ')
}
// Try the parent dir next
prev = dir
dir = join(dir, '..')
}
}

54
node_modules/bindings/package.json generated vendored Normal file
View File

@ -0,0 +1,54 @@
{
"_from": "bindings@^1.3.0",
"_id": "bindings@1.3.0",
"_inBundle": false,
"_integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==",
"_location": "/bindings",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "bindings@^1.3.0",
"name": "bindings",
"escapedName": "bindings",
"rawSpec": "^1.3.0",
"saveSpec": null,
"fetchSpec": "^1.3.0"
},
"_requiredBy": [
"/epoll"
],
"_resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz",
"_shasum": "b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7",
"_spec": "bindings@^1.3.0",
"_where": "/home/wn/workspace-node/PiAlive/node_modules/epoll",
"author": {
"name": "Nathan Rajlich",
"email": "nathan@tootallnate.net",
"url": "http://tootallnate.net"
},
"bugs": {
"url": "https://github.com/TooTallNate/node-bindings/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Helper module for loading your native module's .node file",
"homepage": "https://github.com/TooTallNate/node-bindings",
"keywords": [
"native",
"addon",
"bindings",
"gyp",
"waf",
"c",
"c++"
],
"license": "MIT",
"main": "./bindings.js",
"name": "bindings",
"repository": {
"type": "git",
"url": "git://github.com/TooTallNate/node-bindings.git"
},
"version": "1.3.0"
}

8
node_modules/command-line-args/.travis.yml generated vendored Normal file
View File

@ -0,0 +1,8 @@
language: node_js
node_js:
- 9
- 8
- 7
- 6
- 5
- 4

21
node_modules/command-line-args/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014-18 Lloyd Brookes <75pound@gmail.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:
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.

103
node_modules/command-line-args/README.md generated vendored Normal file
View File

@ -0,0 +1,103 @@
[![view on npm](https://img.shields.io/npm/v/command-line-args.svg)](https://www.npmjs.org/package/command-line-args)
[![npm module downloads](https://img.shields.io/npm/dt/command-line-args.svg)](https://www.npmjs.org/package/command-line-args)
[![Build Status](https://travis-ci.org/75lb/command-line-args.svg?branch=master)](https://travis-ci.org/75lb/command-line-args)
[![Coverage Status](https://coveralls.io/repos/github/75lb/command-line-args/badge.svg?branch=master)](https://coveralls.io/github/75lb/command-line-args?branch=master)
[![Dependency Status](https://david-dm.org/75lb/command-line-args.svg)](https://david-dm.org/75lb/command-line-args)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)
[![Join the chat at https://gitter.im/75lb/command-line-args](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/75lb/command-line-args?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
***Upgraders, please read the [release notes](https://github.com/75lb/command-line-args/releases)***
# command-line-args
A mature, feature-complete library to parse command-line options.
## Synopsis
You can set options using the main notation standards ([learn more](https://github.com/75lb/command-line-args/wiki/Notation-rules)). These commands are all equivalent, setting the same values:
```
$ example --verbose --timeout=1000 --src one.js --src two.js
$ example --verbose --timeout 1000 --src one.js two.js
$ example -vt 1000 --src one.js two.js
$ example -vt 1000 one.js two.js
```
To access the values, first create a list of [option definitions](https://github.com/75lb/command-line-args/blob/master/doc/option-definition.md) describing the options your application accepts. The [`type`](https://github.com/75lb/command-line-args/blob/master/doc/option-definition.md#optiontype--function) property is a setter function (the value supplied is passed through this), giving you full control over the value received.
```js
const optionDefinitions = [
{ name: 'verbose', alias: 'v', type: Boolean },
{ name: 'src', type: String, multiple: true, defaultOption: true },
{ name: 'timeout', alias: 't', type: Number }
]
```
Next, parse the options using [commandLineArgs()](https://github.com/75lb/command-line-args/blob/master/doc/API.md#commandlineargsoptiondefinitions-options--object-):
```js
const commandLineArgs = require('command-line-args')
const options = commandLineArgs(optionDefinitions)
```
`options` now looks like this:
```js
{
src: [
'one.js',
'two.js'
],
verbose: true,
timeout: 1000
}
```
### Advanced usage
Beside the above typical usage, you can configure command-line-args to accept more advanced syntax forms.
* [Command-based syntax](https://github.com/75lb/command-line-args/wiki/Implement-command-parsing-(git-style)) (git style) in the form:
```
$ executable <command> [options]
```
For example.
```
$ git commit --squash -m "This is my commit message"
```
* [Command and sub-command syntax](https://github.com/75lb/command-line-args/wiki/Implement-multiple-command-parsing-(docker-style)) (docker style) in the form:
```
$ executable <command> [options] <sub-command> [options]
```
For example.
```
$ docker run --detached --image centos bash -c yum install -y httpd
```
## Usage guide generation
A usage guide (typically printed when `--help` is set) can be generated using [command-line-usage](https://github.com/75lb/command-line-usage). See the examples below and [read the documentation](https://github.com/75lb/command-line-usage) for instructions how to create them.
A typical usage guide example.
![usage](https://raw.githubusercontent.com/75lb/command-line-usage/master/example/screens/footer.png)
The [polymer-cli](https://github.com/Polymer/polymer-cli/) usage guide is a good real-life example.
![usage](https://raw.githubusercontent.com/75lb/command-line-usage/master/example/screens/polymer.png)
## Further Reading
There is plenty more to learn, please see [the wiki](https://github.com/75lb/command-line-args/wiki) for examples and documentation.
## Install
```sh
$ npm install command-line-args --save
```
* * *
&copy; 2014-18 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown).

35
node_modules/command-line-args/doc/API.md generated vendored Normal file
View File

@ -0,0 +1,35 @@
<a name="module_command-line-args"></a>
## command-line-args
<a name="exp_module_command-line-args--commandLineArgs"></a>
### commandLineArgs(optionDefinitions, [options]) ⇒ <code>object</code>
Returns an object containing all option values set on the command line. By default it parses the global [`process.argv`](https://nodejs.org/api/process.html#process_process_argv) array.
Parsing is strict by default - an exception is thrown if the user sets a singular option more than once or sets an unknown value or option (one without a valid [definition](https://github.com/75lb/command-line-args/blob/master/doc/option-definition.md)). To be more permissive, enabling [partial](https://github.com/75lb/command-line-args/wiki/Partial-mode-example) or [stopAtFirstUnknown](https://github.com/75lb/command-line-args/wiki/stopAtFirstUnknown) modes will return known options in the usual manner while collecting unknown arguments in a separate `_unknown` property.
**Kind**: Exported function
**Throws**:
- `UNKNOWN_OPTION` If `options.partial` is false and the user set an undefined option. The `err.optionName` property contains the arg that specified an unknown option, e.g. `--one`.
- `UNKNOWN_VALUE` If `options.partial` is false and the user set a value unaccounted for by an option definition. The `err.value` property contains the unknown value, e.g. `5`.
- `ALREADY_SET` If a user sets a singular, non-multiple option more than once. The `err.optionName` property contains the option name that has already been set, e.g. `one`.
- `INVALID_DEFINITIONS`
- If an option definition is missing the required `name` property
- If an option definition has a `type` value that's not a function
- If an alias is numeric, a hyphen or a length other than 1
- If an option definition name was used more than once
- If an option definition alias was used more than once
- If more than one option definition has `defaultOption: true`
- If a `Boolean` option is also set as the `defaultOption`.
| Param | Type | Description |
| --- | --- | --- |
| optionDefinitions | <code>Array.&lt;module:definition&gt;</code> | An array of [OptionDefinition](https://github.com/75lb/command-line-args/blob/master/doc/option-definition.md) objects |
| [options] | <code>object</code> | Options. |
| [options.argv] | <code>Array.&lt;string&gt;</code> | An array of strings which, if present will be parsed instead of `process.argv`. |
| [options.partial] | <code>boolean</code> | If `true`, an array of unknown arguments is returned in the `_unknown` property of the output. |
| [options.stopAtFirstUnknown] | <code>boolean</code> | If `true`, parsing will stop at the first unknown argument and the remaining arguments returned in `_unknown`. When set, `partial: true` is also implied. |
| [options.camelCase] | <code>boolean</code> | If `true`, options with hypenated names (e.g. `move-to`) will be returned in camel-case (e.g. `moveTo`). |

244
node_modules/command-line-args/doc/option-definition.md generated vendored Normal file
View File

@ -0,0 +1,244 @@
<a name="module_option-definition"></a>
## option-definition
* [option-definition](#module_option-definition)
* [OptionDefinition](#exp_module_option-definition--OptionDefinition) ⏏
* [.name](#module_option-definition--OptionDefinition+name) : <code>string</code>
* [.type](#module_option-definition--OptionDefinition+type) : <code>function</code>
* [.alias](#module_option-definition--OptionDefinition+alias) : <code>string</code>
* [.multiple](#module_option-definition--OptionDefinition+multiple) : <code>boolean</code>
* [.lazyMultiple](#module_option-definition--OptionDefinition+lazyMultiple) : <code>boolean</code>
* [.defaultOption](#module_option-definition--OptionDefinition+defaultOption) : <code>boolean</code>
* [.defaultValue](#module_option-definition--OptionDefinition+defaultValue) : <code>\*</code>
* [.group](#module_option-definition--OptionDefinition+group) : <code>string</code> \| <code>Array.&lt;string&gt;</code>
<a name="exp_module_option-definition--OptionDefinition"></a>
### OptionDefinition ⏏
Describes a command-line option. Additionally, if generating a usage guide with [command-line-usage](https://github.com/75lb/command-line-usage) you could optionally add `description` and `typeLabel` properties to each definition.
**Kind**: Exported class
<a name="module_option-definition--OptionDefinition+name"></a>
#### option.name : <code>string</code>
The only required definition property is `name`, so the simplest working example is
```js
const optionDefinitions = [
{ name: 'file' },
{ name: 'depth' }
]
```
Where a `type` property is not specified it will default to `String`.
| # | Command line args | .parse() output |
| --- | -------------------- | ------------ |
| 1 | `--file` | `{ file: null }` |
| 2 | `--file lib.js` | `{ file: 'lib.js' }` |
| 3 | `--depth 2` | `{ depth: '2' }` |
Unicode option names and aliases are valid, for example:
```js
const optionDefinitions = [
{ name: 'один' },
{ name: '两' },
{ name: 'три', alias: 'т' }
]
```
**Kind**: instance property of [<code>OptionDefinition</code>](#exp_module_option-definition--OptionDefinition)
<a name="module_option-definition--OptionDefinition+type"></a>
#### option.type : <code>function</code>
The `type` value is a setter function (you receive the output from this), enabling you to be specific about the type and value received.
The most common values used are `String` (the default), `Number` and `Boolean` but you can use a custom function, for example:
```js
const fs = require('fs')
class FileDetails {
constructor (filename) {
this.filename = filename
this.exists = fs.existsSync(filename)
}
}
const cli = commandLineArgs([
{ name: 'file', type: filename => new FileDetails(filename) },
{ name: 'depth', type: Number }
])
```
| # | Command line args| .parse() output |
| --- | ----------------- | ------------ |
| 1 | `--file asdf.txt` | `{ file: { filename: 'asdf.txt', exists: false } }` |
The `--depth` option expects a `Number`. If no value was set, you will receive `null`.
| # | Command line args | .parse() output |
| --- | ----------------- | ------------ |
| 2 | `--depth` | `{ depth: null }` |
| 3 | `--depth 2` | `{ depth: 2 }` |
**Kind**: instance property of [<code>OptionDefinition</code>](#exp_module_option-definition--OptionDefinition)
**Default**: <code>String</code>
<a name="module_option-definition--OptionDefinition+alias"></a>
#### option.alias : <code>string</code>
getopt-style short option names. Can be any single character (unicode included) except a digit or hyphen.
```js
const optionDefinitions = [
{ name: 'hot', alias: 'h', type: Boolean },
{ name: 'discount', alias: 'd', type: Boolean },
{ name: 'courses', alias: 'c' , type: Number }
]
```
| # | Command line | .parse() output |
| --- | ------------ | ------------ |
| 1 | `-hcd` | `{ hot: true, courses: null, discount: true }` |
| 2 | `-hdc 3` | `{ hot: true, discount: true, courses: 3 }` |
**Kind**: instance property of [<code>OptionDefinition</code>](#exp_module_option-definition--OptionDefinition)
<a name="module_option-definition--OptionDefinition+multiple"></a>
#### option.multiple : <code>boolean</code>
Set this flag if the option takes a list of values. You will receive an array of values, each passed through the `type` function (if specified).
```js
const optionDefinitions = [
{ name: 'files', type: String, multiple: true }
]
```
Note, examples 1 and 3 below demonstrate "greedy" parsing which can be disabled by using `lazyMultiple`.
| # | Command line | .parse() output |
| --- | ------------ | ------------ |
| 1 | `--files one.js two.js` | `{ files: [ 'one.js', 'two.js' ] }` |
| 2 | `--files one.js --files two.js` | `{ files: [ 'one.js', 'two.js' ] }` |
| 3 | `--files *` | `{ files: [ 'one.js', 'two.js' ] }` |
**Kind**: instance property of [<code>OptionDefinition</code>](#exp_module_option-definition--OptionDefinition)
<a name="module_option-definition--OptionDefinition+lazyMultiple"></a>
#### option.lazyMultiple : <code>boolean</code>
Identical to `multiple` but with greedy parsing disabled.
```js
const optionDefinitions = [
{ name: 'files', lazyMultiple: true },
{ name: 'verbose', alias: 'v', type: Boolean, lazyMultiple: true }
]
```
| # | Command line | .parse() output |
| --- | ------------ | ------------ |
| 1 | `--files one.js --files two.js` | `{ files: [ 'one.js', 'two.js' ] }` |
| 2 | `-vvv` | `{ verbose: [ true, true, true ] }` |
**Kind**: instance property of [<code>OptionDefinition</code>](#exp_module_option-definition--OptionDefinition)
<a name="module_option-definition--OptionDefinition+defaultOption"></a>
#### option.defaultOption : <code>boolean</code>
Any values unaccounted for by an option definition will be set on the `defaultOption`. This flag is typically set on the most commonly-used option to make for more concise usage (i.e. `$ example *.js` instead of `$ example --files *.js`).
```js
const optionDefinitions = [
{ name: 'files', multiple: true, defaultOption: true }
]
```
| # | Command line | .parse() output |
| --- | ------------ | ------------ |
| 1 | `--files one.js two.js` | `{ files: [ 'one.js', 'two.js' ] }` |
| 2 | `one.js two.js` | `{ files: [ 'one.js', 'two.js' ] }` |
| 3 | `*` | `{ files: [ 'one.js', 'two.js' ] }` |
**Kind**: instance property of [<code>OptionDefinition</code>](#exp_module_option-definition--OptionDefinition)
<a name="module_option-definition--OptionDefinition+defaultValue"></a>
#### option.defaultValue : <code>\*</code>
An initial value for the option.
```js
const optionDefinitions = [
{ name: 'files', multiple: true, defaultValue: [ 'one.js' ] },
{ name: 'max', type: Number, defaultValue: 3 }
]
```
| # | Command line | .parse() output |
| --- | ------------ | ------------ |
| 1 | | `{ files: [ 'one.js' ], max: 3 }` |
| 2 | `--files two.js` | `{ files: [ 'two.js' ], max: 3 }` |
| 3 | `--max 4` | `{ files: [ 'one.js' ], max: 4 }` |
**Kind**: instance property of [<code>OptionDefinition</code>](#exp_module_option-definition--OptionDefinition)
<a name="module_option-definition--OptionDefinition+group"></a>
#### option.group : <code>string</code> \| <code>Array.&lt;string&gt;</code>
When your app has a large amount of options it makes sense to organise them in groups.
There are two automatic groups: `_all` (contains all options) and `_none` (contains options without a `group` specified in their definition).
```js
const optionDefinitions = [
{ name: 'verbose', group: 'standard' },
{ name: 'help', group: [ 'standard', 'main' ] },
{ name: 'compress', group: [ 'server', 'main' ] },
{ name: 'static', group: 'server' },
{ name: 'debug' }
]
```
<table>
<tr>
<th>#</th><th>Command Line</th><th>.parse() output</th>
</tr>
<tr>
<td>1</td><td><code>--verbose</code></td><td><pre><code>
{
_all: { verbose: true },
standard: { verbose: true }
}
</code></pre></td>
</tr>
<tr>
<td>2</td><td><code>--debug</code></td><td><pre><code>
{
_all: { debug: true },
_none: { debug: true }
}
</code></pre></td>
</tr>
<tr>
<td>3</td><td><code>--verbose --debug --compress</code></td><td><pre><code>
{
_all: {
verbose: true,
debug: true,
compress: true
},
standard: { verbose: true },
server: { compress: true },
main: { compress: true },
_none: { debug: true }
}
</code></pre></td>
</tr>
<tr>
<td>4</td><td><code>--compress</code></td><td><pre><code>
{
_all: { compress: true },
server: { compress: true },
main: { compress: true }
}
</code></pre></td>
</tr>
</table>
**Kind**: instance property of [<code>OptionDefinition</code>](#exp_module_option-definition--OptionDefinition)

82
node_modules/command-line-args/index.js generated vendored Normal file
View File

@ -0,0 +1,82 @@
'use strict'
/**
* @module command-line-args
*/
module.exports = commandLineArgs
/**
* Returns an object containing all option values set on the command line. By default it parses the global [`process.argv`](https://nodejs.org/api/process.html#process_process_argv) array.
*
* Parsing is strict by default - an exception is thrown if the user sets a singular option more than once or sets an unknown value or option (one without a valid [definition](https://github.com/75lb/command-line-args/blob/master/doc/option-definition.md)). To be more permissive, enabling [partial](https://github.com/75lb/command-line-args/wiki/Partial-mode-example) or [stopAtFirstUnknown](https://github.com/75lb/command-line-args/wiki/stopAtFirstUnknown) modes will return known options in the usual manner while collecting unknown arguments in a separate `_unknown` property.
*
* @param {module:definition[]} - An array of [OptionDefinition](https://github.com/75lb/command-line-args/blob/master/doc/option-definition.md) objects
* @param {object} [options] - Options.
* @param {string[]} [options.argv] - An array of strings which, if present will be parsed instead of `process.argv`.
* @param {boolean} [options.partial] - If `true`, an array of unknown arguments is returned in the `_unknown` property of the output.
* @param {boolean} [options.stopAtFirstUnknown] - If `true`, parsing will stop at the first unknown argument and the remaining arguments returned in `_unknown`. When set, `partial: true` is also implied.
* @param {boolean} [options.camelCase] - If `true`, options with hypenated names (e.g. `move-to`) will be returned in camel-case (e.g. `moveTo`).
* @returns {object}
* @throws `UNKNOWN_OPTION` If `options.partial` is false and the user set an undefined option. The `err.optionName` property contains the arg that specified an unknown option, e.g. `--one`.
* @throws `UNKNOWN_VALUE` If `options.partial` is false and the user set a value unaccounted for by an option definition. The `err.value` property contains the unknown value, e.g. `5`.
* @throws `ALREADY_SET` If a user sets a singular, non-multiple option more than once. The `err.optionName` property contains the option name that has already been set, e.g. `one`.
* @throws `INVALID_DEFINITIONS`
* - If an option definition is missing the required `name` property
* - If an option definition has a `type` value that's not a function
* - If an alias is numeric, a hyphen or a length other than 1
* - If an option definition name was used more than once
* - If an option definition alias was used more than once
* - If more than one option definition has `defaultOption: true`
* - If a `Boolean` option is also set as the `defaultOption`.
* @alias module:command-line-args
*/
function commandLineArgs (optionDefinitions, options) {
options = options || {}
if (options.stopAtFirstUnknown) options.partial = true
const Definitions = require('./lib/option-definitions')
optionDefinitions = Definitions.from(optionDefinitions)
const ArgvParser = require('./lib/argv-parser')
const parser = new ArgvParser(optionDefinitions, {
argv: options.argv,
stopAtFirstUnknown: options.stopAtFirstUnknown
})
const Option = require('./lib/option')
const OutputClass = optionDefinitions.isGrouped() ? require('./lib/output-grouped') : require('./lib/output')
const output = new OutputClass(optionDefinitions)
/* Iterate the parser setting each known value to the output. Optionally, throw on unknowns. */
for (const argInfo of parser) {
const arg = argInfo.subArg || argInfo.arg
if (!options.partial) {
if (argInfo.event === 'unknown_value') {
const err = new Error(`Unknown value: ${arg}`)
err.name = 'UNKNOWN_VALUE'
err.value = arg
throw err
} else if (argInfo.event === 'unknown_option') {
const err = new Error(`Unknown option: ${arg}`)
err.name = 'UNKNOWN_OPTION'
err.optionName = arg
throw err
}
}
let option
if (output.has(argInfo.name)) {
option = output.get(argInfo.name)
} else {
option = Option.create(argInfo.def)
output.set(argInfo.name, option)
}
if (argInfo.name === '_unknown') {
option.set(arg)
} else {
option.set(argInfo.value)
}
}
return output.toObject({ skipUnknown: !options.partial, camelCase: options.camelCase })
}

139
node_modules/command-line-args/lib/argv-parser.js generated vendored Normal file
View File

@ -0,0 +1,139 @@
'use strict'
const argvTools = require('argv-tools')
/**
* @module argv-parser
*/
/**
* @alias module:argv-parser
*/
class ArgvParser {
/**
* @param {OptionDefinitions} - Definitions array
* @param {object} [options] - Options
* @param {string[]} [options.argv] - Overrides `process.argv`
* @param {boolean} [options.stopAtFirstUnknown] -
*/
constructor (definitions, options) {
this.options = Object.assign({}, options)
const Definitions = require('./option-definitions')
/**
* Option Definitions
*/
this.definitions = Definitions.from(definitions)
/**
* Argv
*/
this.argv = argvTools.ArgvArray.from(this.options.argv)
if (this.argv.hasCombinedShortOptions()) {
const findReplace = require('find-replace')
findReplace(this.argv, argvTools.re.combinedShort, arg => {
arg = arg.slice(1)
return arg.split('').map(letter => ({ origArg: `-${arg}`, arg: '-' + letter }))
})
}
}
/**
* Yields one `{ event, name, value, arg, def }` argInfo object for each arg in `process.argv` (or `options.argv`).
*/
* [Symbol.iterator] () {
const definitions = this.definitions
const t = require('typical')
let def
let value
let name
let event
let singularDefaultSet = false
let unknownFound = false
let origArg
for (let arg of this.argv) {
if (t.isPlainObject(arg)) {
origArg = arg.origArg
arg = arg.arg
}
if (unknownFound && this.options.stopAtFirstUnknown) {
yield { event: 'unknown_value', arg, name: '_unknown', value: undefined }
continue
}
/* handle long or short option */
if (argvTools.isOption(arg)) {
def = definitions.get(arg)
value = undefined
if (def) {
value = def.isBoolean() ? true : null
event = 'set'
} else {
event = 'unknown_option'
}
/* handle --option-value notation */
} else if (argvTools.isOptionEqualsNotation(arg)) {
const matches = arg.match(argvTools.re.optEquals)
def = definitions.get(matches[1])
if (def) {
if (def.isBoolean()) {
yield { event: 'unknown_value', arg, name: '_unknown', value, def }
event = 'set'
value = true
} else {
event = 'set'
value = matches[2]
}
} else {
event = 'unknown_option'
}
/* handle value */
} else if (argvTools.isValue(arg)) {
if (def) {
value = arg
event = 'set'
} else {
/* get the defaultOption */
def = this.definitions.getDefault()
if (def && !singularDefaultSet) {
value = arg
event = 'set'
} else {
event = 'unknown_value'
def = undefined
}
}
}
name = def ? def.name : '_unknown'
const argInfo = { event, arg, name, value, def }
if (origArg) {
argInfo.subArg = arg
argInfo.arg = origArg
}
yield argInfo
/* unknownFound logic */
if (name === '_unknown') unknownFound = true
/* singularDefaultSet logic */
if (def && def.defaultOption && !def.isMultiple() && event === 'set') singularDefaultSet = true
/* reset values once consumed and yielded */
if (def && def.isBoolean()) def = undefined
/* reset the def if it's a singular which has been set */
if (def && !def.multiple && t.isDefined(value) && value !== null) {
def = undefined
}
value = undefined
event = undefined
name = undefined
origArg = undefined
}
}
}
module.exports = ArgvParser

265
node_modules/command-line-args/lib/option-definition.js generated vendored Normal file
View File

@ -0,0 +1,265 @@
'use strict'
const t = require('typical')
/**
* @module option-definition
*/
/**
* Describes a command-line option. Additionally, if generating a usage guide with [command-line-usage](https://github.com/75lb/command-line-usage) you could optionally add `description` and `typeLabel` properties to each definition.
*
* @alias module:option-definition
* @typicalname option
*/
class OptionDefinition {
constructor (definition) {
/**
* The only required definition property is `name`, so the simplest working example is
* ```js
* const optionDefinitions = [
* { name: 'file' },
* { name: 'depth' }
* ]
* ```
*
* Where a `type` property is not specified it will default to `String`.
*
* | # | Command line args | .parse() output |
* | --- | -------------------- | ------------ |
* | 1 | `--file` | `{ file: null }` |
* | 2 | `--file lib.js` | `{ file: 'lib.js' }` |
* | 3 | `--depth 2` | `{ depth: '2' }` |
*
* Unicode option names and aliases are valid, for example:
* ```js
* const optionDefinitions = [
* { name: 'один' },
* { name: '两' },
* { name: 'три', alias: 'т' }
* ]
* ```
* @type {string}
*/
this.name = definition.name
/**
* The `type` value is a setter function (you receive the output from this), enabling you to be specific about the type and value received.
*
* The most common values used are `String` (the default), `Number` and `Boolean` but you can use a custom function, for example:
*
* ```js
* const fs = require('fs')
*
* class FileDetails {
* constructor (filename) {
* this.filename = filename
* this.exists = fs.existsSync(filename)
* }
* }
*
* const cli = commandLineArgs([
* { name: 'file', type: filename => new FileDetails(filename) },
* { name: 'depth', type: Number }
* ])
* ```
*
* | # | Command line args| .parse() output |
* | --- | ----------------- | ------------ |
* | 1 | `--file asdf.txt` | `{ file: { filename: 'asdf.txt', exists: false } }` |
*
* The `--depth` option expects a `Number`. If no value was set, you will receive `null`.
*
* | # | Command line args | .parse() output |
* | --- | ----------------- | ------------ |
* | 2 | `--depth` | `{ depth: null }` |
* | 3 | `--depth 2` | `{ depth: 2 }` |
*
* @type {function}
* @default String
*/
this.type = definition.type || String
/**
* getopt-style short option names. Can be any single character (unicode included) except a digit or hyphen.
*
* ```js
* const optionDefinitions = [
* { name: 'hot', alias: 'h', type: Boolean },
* { name: 'discount', alias: 'd', type: Boolean },
* { name: 'courses', alias: 'c' , type: Number }
* ]
* ```
*
* | # | Command line | .parse() output |
* | --- | ------------ | ------------ |
* | 1 | `-hcd` | `{ hot: true, courses: null, discount: true }` |
* | 2 | `-hdc 3` | `{ hot: true, discount: true, courses: 3 }` |
*
* @type {string}
*/
this.alias = definition.alias
/**
* Set this flag if the option takes a list of values. You will receive an array of values, each passed through the `type` function (if specified).
*
* ```js
* const optionDefinitions = [
* { name: 'files', type: String, multiple: true }
* ]
* ```
*
* Note, examples 1 and 3 below demonstrate "greedy" parsing which can be disabled by using `lazyMultiple`.
*
* | # | Command line | .parse() output |
* | --- | ------------ | ------------ |
* | 1 | `--files one.js two.js` | `{ files: [ 'one.js', 'two.js' ] }` |
* | 2 | `--files one.js --files two.js` | `{ files: [ 'one.js', 'two.js' ] }` |
* | 3 | `--files *` | `{ files: [ 'one.js', 'two.js' ] }` |
*
* @type {boolean}
*/
this.multiple = definition.multiple
/**
* Identical to `multiple` but with greedy parsing disabled.
*
* ```js
* const optionDefinitions = [
* { name: 'files', lazyMultiple: true },
* { name: 'verbose', alias: 'v', type: Boolean, lazyMultiple: true }
* ]
* ```
*
* | # | Command line | .parse() output |
* | --- | ------------ | ------------ |
* | 1 | `--files one.js --files two.js` | `{ files: [ 'one.js', 'two.js' ] }` |
* | 2 | `-vvv` | `{ verbose: [ true, true, true ] }` |
*
* @type {boolean}
*/
this.lazyMultiple = definition.lazyMultiple
/**
* Any values unaccounted for by an option definition will be set on the `defaultOption`. This flag is typically set on the most commonly-used option to make for more concise usage (i.e. `$ example *.js` instead of `$ example --files *.js`).
*
* ```js
* const optionDefinitions = [
* { name: 'files', multiple: true, defaultOption: true }
* ]
* ```
*
* | # | Command line | .parse() output |
* | --- | ------------ | ------------ |
* | 1 | `--files one.js two.js` | `{ files: [ 'one.js', 'two.js' ] }` |
* | 2 | `one.js two.js` | `{ files: [ 'one.js', 'two.js' ] }` |
* | 3 | `*` | `{ files: [ 'one.js', 'two.js' ] }` |
*
* @type {boolean}
*/
this.defaultOption = definition.defaultOption
/**
* An initial value for the option.
*
* ```js
* const optionDefinitions = [
* { name: 'files', multiple: true, defaultValue: [ 'one.js' ] },
* { name: 'max', type: Number, defaultValue: 3 }
* ]
* ```
*
* | # | Command line | .parse() output |
* | --- | ------------ | ------------ |
* | 1 | | `{ files: [ 'one.js' ], max: 3 }` |
* | 2 | `--files two.js` | `{ files: [ 'two.js' ], max: 3 }` |
* | 3 | `--max 4` | `{ files: [ 'one.js' ], max: 4 }` |
*
* @type {*}
*/
this.defaultValue = definition.defaultValue
/**
* When your app has a large amount of options it makes sense to organise them in groups.
*
* There are two automatic groups: `_all` (contains all options) and `_none` (contains options without a `group` specified in their definition).
*
* ```js
* const optionDefinitions = [
* { name: 'verbose', group: 'standard' },
* { name: 'help', group: [ 'standard', 'main' ] },
* { name: 'compress', group: [ 'server', 'main' ] },
* { name: 'static', group: 'server' },
* { name: 'debug' }
* ]
* ```
*
*<table>
* <tr>
* <th>#</th><th>Command Line</th><th>.parse() output</th>
* </tr>
* <tr>
* <td>1</td><td><code>--verbose</code></td><td><pre><code>
*{
* _all: { verbose: true },
* standard: { verbose: true }
*}
*</code></pre></td>
* </tr>
* <tr>
* <td>2</td><td><code>--debug</code></td><td><pre><code>
*{
* _all: { debug: true },
* _none: { debug: true }
*}
*</code></pre></td>
* </tr>
* <tr>
* <td>3</td><td><code>--verbose --debug --compress</code></td><td><pre><code>
*{
* _all: {
* verbose: true,
* debug: true,
* compress: true
* },
* standard: { verbose: true },
* server: { compress: true },
* main: { compress: true },
* _none: { debug: true }
*}
*</code></pre></td>
* </tr>
* <tr>
* <td>4</td><td><code>--compress</code></td><td><pre><code>
*{
* _all: { compress: true },
* server: { compress: true },
* main: { compress: true }
*}
*</code></pre></td>
* </tr>
*</table>
*
* @type {string|string[]}
*/
this.group = definition.group
/* pick up any remaining properties */
for (let prop in definition) {
if (!this[prop]) this[prop] = definition[prop]
}
}
isBoolean () {
return this.type === Boolean || (t.isFunction(this.type) && this.type.name === 'Boolean')
}
isMultiple () {
return this.multiple || this.lazyMultiple
}
static create (def) {
const result = new this(def)
return result
}
}
module.exports = OptionDefinition

View File

@ -0,0 +1,170 @@
'use strict'
const arrayify = require('array-back')
const argvTools = require('argv-tools')
const t = require('typical')
/**
* @module option-definitions
*/
/**
* @alias module:option-definitions
*/
class Definitions extends Array {
/**
* validate option definitions
* @returns {string}
*/
validate () {
const someHaveNoName = this.some(def => !def.name)
if (someHaveNoName) {
halt(
'INVALID_DEFINITIONS',
'Invalid option definitions: the `name` property is required on each definition'
)
}
const someDontHaveFunctionType = this.some(def => def.type && typeof def.type !== 'function')
if (someDontHaveFunctionType) {
halt(
'INVALID_DEFINITIONS',
'Invalid option definitions: the `type` property must be a setter fuction (default: `Boolean`)'
)
}
let invalidOption
const numericAlias = this.some(def => {
invalidOption = def
return t.isDefined(def.alias) && t.isNumber(def.alias)
})
if (numericAlias) {
halt(
'INVALID_DEFINITIONS',
'Invalid option definition: to avoid ambiguity an alias cannot be numeric [--' + invalidOption.name + ' alias is -' + invalidOption.alias + ']'
)
}
const multiCharacterAlias = this.some(def => {
invalidOption = def
return t.isDefined(def.alias) && def.alias.length !== 1
})
if (multiCharacterAlias) {
halt(
'INVALID_DEFINITIONS',
'Invalid option definition: an alias must be a single character'
)
}
const hypenAlias = this.some(def => {
invalidOption = def
return def.alias === '-'
})
if (hypenAlias) {
halt(
'INVALID_DEFINITIONS',
'Invalid option definition: an alias cannot be "-"'
)
}
const duplicateName = hasDuplicates(this.map(def => def.name))
if (duplicateName) {
halt(
'INVALID_DEFINITIONS',
'Two or more option definitions have the same name'
)
}
const duplicateAlias = hasDuplicates(this.map(def => def.alias))
if (duplicateAlias) {
halt(
'INVALID_DEFINITIONS',
'Two or more option definitions have the same alias'
)
}
const duplicateDefaultOption = hasDuplicates(this.map(def => def.defaultOption))
if (duplicateDefaultOption) {
halt(
'INVALID_DEFINITIONS',
'Only one option definition can be the defaultOption'
)
}
const defaultBoolean = this.some(def => {
invalidOption = def
return def.isBoolean() && def.defaultOption
})
if (defaultBoolean) {
halt(
'INVALID_DEFINITIONS',
`A boolean option ["${invalidOption.name}"] can not also be the defaultOption.`
)
}
}
/**
* Get definition by option arg (e.g. `--one` or `-o`)
* @param {string}
* @returns {Definition}
*/
get (arg) {
if (argvTools.isOption(arg)) {
return argvTools.re.short.test(arg)
? this.find(def => def.alias === argvTools.getOptionName(arg))
: this.find(def => def.name === argvTools.getOptionName(arg))
} else {
return this.find(def => def.name === arg)
}
}
getDefault () {
return this.find(def => def.defaultOption === true)
}
isGrouped () {
return this.some(def => def.group)
}
whereGrouped () {
return this.filter(containsValidGroup)
}
whereNotGrouped () {
return this.filter(def => !containsValidGroup(def))
}
whereDefaultValueSet () {
return this.filter(def => t.isDefined(def.defaultValue))
}
static from (definitions) {
if (definitions instanceof this) return definitions
const Definition = require('./option-definition')
const result = super.from(arrayify(definitions), def => Definition.create(def))
result.validate()
return result
}
}
function halt (name, message) {
const err = new Error(message)
err.name = name
throw err
}
function containsValidGroup (def) {
return arrayify(def.group).some(group => group)
}
function hasDuplicates (array) {
const items = {}
for (let i = 0; i < array.length; i++) {
const value = array[i]
if (items[value]) {
return true
} else {
if (t.isDefined(value)) items[value] = true
}
}
}
module.exports = Definitions

14
node_modules/command-line-args/lib/option-flag.js generated vendored Normal file
View File

@ -0,0 +1,14 @@
'use strict'
const Option = require('./option')
class FlagOption extends Option {
set (val) {
super.set(true)
}
static create (def) {
return new this(def)
}
}
module.exports = FlagOption

83
node_modules/command-line-args/lib/option.js generated vendored Normal file
View File

@ -0,0 +1,83 @@
'use strict'
const _value = new WeakMap()
const arrayify = require('array-back')
const t = require('typical')
const Definition = require('./option-definition')
/**
* Encapsulates behaviour (defined by an OptionDefinition) when setting values
*/
class Option {
constructor (definition) {
this.definition = new Definition(definition)
this.state = null /* set or default */
this.resetToDefault()
}
get () {
return _value.get(this)
}
set (val) {
this._set(val, 'set')
}
_set (val, state) {
const def = this.definition
if (def.isMultiple()) {
/* don't add null or undefined to a multiple */
if (val !== null && val !== undefined) {
const arr = this.get()
if (this.state === 'default') arr.length = 0
arr.push(def.type(val))
this.state = state
}
} else {
/* throw if already set on a singlar defaultOption */
if (!def.isMultiple() && this.state === 'set') {
const err = new Error(`Singular option already set [${this.definition.name}=${this.get()}]`)
err.name = 'ALREADY_SET'
err.value = val
err.optionName = def.name
throw err
} else if (val === null || val === undefined) {
_value.set(this, val)
// /* required to make 'partial: defaultOption with value equal to defaultValue 2' pass */
// if (!(def.defaultOption && !def.isMultiple())) {
// this.state = state
// }
} else {
_value.set(this, def.type(val))
this.state = state
}
}
}
resetToDefault () {
if (t.isDefined(this.definition.defaultValue)) {
if (this.definition.isMultiple()) {
_value.set(this, arrayify(this.definition.defaultValue).slice())
} else {
_value.set(this, this.definition.defaultValue)
}
} else {
if (this.definition.isMultiple()) {
_value.set(this, [])
} else {
_value.set(this, null)
}
}
this.state = 'default'
}
static create (definition) {
definition = new Definition(definition)
if (definition.isBoolean()) {
return require('./option-flag').create(definition)
} else {
return new this(definition)
}
}
}
module.exports = Option

41
node_modules/command-line-args/lib/output-grouped.js generated vendored Normal file
View File

@ -0,0 +1,41 @@
'use strict'
const Output = require('./output')
class GroupedOutput extends Output {
toObject (options) {
const arrayify = require('array-back')
const t = require('typical')
const camelCase = require('lodash.camelcase')
const superOutputNoCamel = super.toObject({ skipUnknown: options.skipUnknown })
const superOutput = super.toObject(options)
const unknown = superOutput._unknown
delete superOutput._unknown
const grouped = {
_all: superOutput
}
if (unknown && unknown.length) grouped._unknown = unknown
this.definitions.whereGrouped().forEach(def => {
const name = options.camelCase ? camelCase(def.name) : def.name
const outputValue = superOutputNoCamel[def.name]
for (const groupName of arrayify(def.group)) {
grouped[groupName] = grouped[groupName] || {}
if (t.isDefined(outputValue)) {
grouped[groupName][name] = outputValue
}
}
})
this.definitions.whereNotGrouped().forEach(def => {
const name = options.camelCase ? camelCase(def.name) : def.name
const outputValue = superOutputNoCamel[def.name]
if (t.isDefined(outputValue)) {
if (!grouped._none) grouped._none = {}
grouped._none[name] = outputValue
}
})
return grouped
}
}
module.exports = GroupedOutput

39
node_modules/command-line-args/lib/output.js generated vendored Normal file
View File

@ -0,0 +1,39 @@
'use strict'
const Option = require('./option')
/**
* A map of { DefinitionNameString: Option }. By default, an Output has an `_unknown` property and any options with defaultValues.
*/
class Output extends Map {
constructor (definitions) {
super()
const Definitions = require('./option-definitions')
/**
* @type {OptionDefinitions}
*/
this.definitions = Definitions.from(definitions)
/* by default, an Output has an `_unknown` property and any options with defaultValues */
this.set('_unknown', Option.create({ name: '_unknown', multiple: true }))
for (const def of this.definitions.whereDefaultValueSet()) {
this.set(def.name, Option.create(def))
}
}
toObject (options) {
const camelCase = require('lodash.camelcase')
options = options || {}
const output = {}
for (const item of this) {
const name = options.camelCase && item[0] !== '_unknown' ? camelCase(item[0]) : item[0]
const option = item[1]
if (name === '_unknown' && !option.get().length) continue
output[name] = option.get()
}
if (options.skipUnknown) delete output._unknown
return output
}
}
module.exports = Output

77
node_modules/command-line-args/package.json generated vendored Normal file
View File

@ -0,0 +1,77 @@
{
"_from": "command-line-args",
"_id": "command-line-args@5.0.2",
"_inBundle": false,
"_integrity": "sha512-/qPcbL8zpqg53x4rAaqMFlRV4opN3pbla7I7k9x8kyOBMQoGT6WltjN6sXZuxOXw6DgdK7Ad+ijYS5gjcr7vlA==",
"_location": "/command-line-args",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "command-line-args",
"name": "command-line-args",
"escapedName": "command-line-args",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.0.2.tgz",
"_shasum": "c4e56b016636af1323cf485aa25c3cb203dfbbe4",
"_spec": "command-line-args",
"_where": "/home/wn/workspace-node/PiAlive",
"author": {
"name": "Lloyd Brookes",
"email": "75pound@gmail.com"
},
"bugs": {
"url": "https://github.com/75lb/command-line-args/issues"
},
"bundleDependencies": false,
"dependencies": {
"argv-tools": "^0.1.1",
"array-back": "^2.0.0",
"find-replace": "^2.0.1",
"lodash.camelcase": "^4.3.0",
"typical": "^2.6.1"
},
"deprecated": false,
"description": "A mature, feature-complete library to parse command-line options.",
"devDependencies": {
"coveralls": "^3.0.0",
"jsdoc-to-markdown": "^4.0.1",
"test-runner": "^0.5.0"
},
"engines": {
"node": ">=4.0.0"
},
"homepage": "https://github.com/75lb/command-line-args#readme",
"keywords": [
"argv",
"parse",
"argument",
"args",
"option",
"options",
"parser",
"parsing",
"cli",
"command",
"line"
],
"license": "MIT",
"name": "command-line-args",
"repository": {
"type": "git",
"url": "git+https://github.com/75lb/command-line-args.git"
},
"scripts": {
"cover": "istanbul cover ./node_modules/.bin/test-runner test/*.js test/internals/*.js && cat coverage/lcov.info | ./node_modules/.bin/coveralls #&& rm -rf coverage; echo",
"docs": "jsdoc2md index.js > doc/API.md && jsdoc2md lib/option-definition.js > doc/option-definition.md",
"test": "test-runner test/*.js test/internals/*.js"
},
"version": "5.0.2"
}

38
node_modules/command-line-args/test/alias.js generated vendored Normal file
View File

@ -0,0 +1,38 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('alias: one string alias', function () {
const optionDefinitions = [
{ name: 'verbose', alias: 'v' }
]
const argv = [ '-v' ]
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv }), {
verbose: null
})
})
runner.test('alias: one boolean alias', function () {
const optionDefinitions = [
{ name: 'dry-run', alias: 'd', type: Boolean }
]
const argv = [ '-d' ]
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv }), {
'dry-run': true
})
})
runner.test('alias: one boolean, one string', function () {
const optionDefinitions = [
{ name: 'verbose', alias: 'v', type: Boolean },
{ name: 'colour', alias: 'c' }
]
const argv = [ '-v', '-c' ]
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv }), {
verbose: true,
colour: null
})
})

44
node_modules/command-line-args/test/ambiguous-input.js generated vendored Normal file
View File

@ -0,0 +1,44 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('ambiguous input: value looks like an option 1', function () {
const optionDefinitions = [
{ name: 'colour', type: String, alias: 'c' }
]
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv: [ '-c', 'red' ] }), {
colour: 'red'
})
})
runner.test('ambiguous input: value looks like an option 2', function () {
const optionDefinitions = [
{ name: 'colour', type: String, alias: 'c' }
]
const argv = [ '--colour', '--red' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'UNKNOWN_OPTION'
)
})
runner.test('ambiguous input: value looks like an option 3', function () {
const optionDefinitions = [
{ name: 'colour', type: String, alias: 'c' }
]
a.doesNotThrow(function () {
commandLineArgs(optionDefinitions, { argv: [ '--colour=--red' ] })
})
})
runner.test('ambiguous input: value looks like an option 4', function () {
const optionDefinitions = [
{ name: 'colour', type: String, alias: 'c' }
]
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv: [ '--colour=--red' ] }), {
colour: '--red'
})
})

61
node_modules/command-line-args/test/bad-input.js generated vendored Normal file
View File

@ -0,0 +1,61 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('bad-input: missing option value should be null', function () {
const optionDefinitions = [
{ name: 'colour', type: String },
{ name: 'files' }
]
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv: [ '--colour' ] }), {
colour: null
})
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv: [ '--colour', '--files', 'yeah' ] }), {
colour: null,
files: 'yeah'
})
})
runner.test('bad-input: handles arrays with relative paths', function () {
const optionDefinitions = [
{ name: 'colours', type: String, multiple: true }
]
const argv = [ '--colours', '../what', '../ever' ]
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv }), {
colours: [ '../what', '../ever' ]
})
})
runner.test('bad-input: empty string added to unknown values', function () {
const optionDefinitions = [
{ name: 'one', type: String },
{ name: 'two', type: Number },
{ name: 'three', type: Number, multiple: true },
{ name: 'four', type: String },
{ name: 'five', type: Boolean }
]
const argv = [ '--one', '', '', '--two', '0', '--three=', '', '--four=', '--five=' ]
a.throws(() => {
commandLineArgs(optionDefinitions, { argv })
})
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv, partial: true }), {
one: '',
two: 0,
three: [ 0, 0 ],
four: '',
five: true,
_unknown: [ '', '--five=' ]
})
})
runner.test('bad-input: non-strings in argv', function () {
const optionDefinitions = [
{ name: 'one', type: Number }
]
const argv = [ '--one', 1 ]
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, { one: 1 })
})

78
node_modules/command-line-args/test/camel-case.js generated vendored Normal file
View File

@ -0,0 +1,78 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('camel-case: regular', function () {
const optionDefinitions = [
{ name: 'one-two' },
{ name: 'three', type: Boolean }
]
const argv = [ '--one-two', '1', '--three' ]
const result = commandLineArgs(optionDefinitions, { argv, camelCase: true })
a.deepStrictEqual(result, {
oneTwo: '1',
three: true
})
})
runner.test('camel-case: grouped', function () {
const optionDefinitions = [
{ name: 'one-one', group: 'a' },
{ name: 'two-two', group: 'a' },
{ name: 'three-three', group: 'b', type: Boolean },
{ name: 'four-four' }
]
const argv = [ '--one-one', '1', '--two-two', '2', '--three-three', '--four-four', '4' ]
const result = commandLineArgs(optionDefinitions, { argv, camelCase: true })
a.deepStrictEqual(result, {
a: {
oneOne: '1',
twoTwo: '2'
},
b: {
threeThree: true
},
_all: {
oneOne: '1',
twoTwo: '2',
threeThree: true,
fourFour: '4'
},
_none: {
fourFour: '4'
}
})
})
runner.test('camel-case: grouped with unknowns', function () {
const optionDefinitions = [
{ name: 'one-one', group: 'a' },
{ name: 'two-two', group: 'a' },
{ name: 'three-three', group: 'b', type: Boolean },
{ name: 'four-four' }
]
const argv = [ '--one-one', '1', '--two-two', '2', '--three-three', '--four-four', '4', '--five' ]
const result = commandLineArgs(optionDefinitions, { argv, camelCase: true, partial: true })
a.deepStrictEqual(result, {
a: {
oneOne: '1',
twoTwo: '2'
},
b: {
threeThree: true
},
_all: {
oneOne: '1',
twoTwo: '2',
threeThree: true,
fourFour: '4'
},
_none: {
fourFour: '4'
},
_unknown: [ '--five' ]
})
})

55
node_modules/command-line-args/test/default-option.js generated vendored Normal file
View File

@ -0,0 +1,55 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('defaultOption: multiple string', function () {
const optionDefinitions = [
{ name: 'files', defaultOption: true, multiple: true }
]
const argv = [ 'file1', 'file2' ]
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv }), {
files: [ 'file1', 'file2' ]
})
})
runner.test('defaultOption: after a boolean', function () {
const definitions = [
{ name: 'one', type: Boolean },
{ name: 'two', defaultOption: true }
]
a.deepStrictEqual(
commandLineArgs(definitions, { argv: [ '--one', 'sfsgf' ] }),
{ one: true, two: 'sfsgf' }
)
})
runner.test('defaultOption: multiple-defaultOption values spread out', function () {
const optionDefinitions = [
{ name: 'one' },
{ name: 'two' },
{ name: 'files', defaultOption: true, multiple: true }
]
const argv = [ '--one', '1', 'file1', 'file2', '--two', '2' ]
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv }), {
one: '1',
two: '2',
files: [ 'file1', 'file2' ]
})
})
runner.test('defaultOption: multiple-defaultOption values spread out 2', function () {
const optionDefinitions = [
{ name: 'one', type: Boolean },
{ name: 'two' },
{ name: 'files', defaultOption: true, multiple: true }
]
const argv = [ 'file0', '--one', 'file1', '--files', 'file2', '--two', '2', 'file3' ]
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv }), {
one: true,
two: '2',
files: [ 'file0', 'file1', 'file2', 'file3' ]
})
})

154
node_modules/command-line-args/test/default-value.js generated vendored Normal file
View File

@ -0,0 +1,154 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('default value', function () {
const defs = [
{ name: 'one' },
{ name: 'two', defaultValue: 'two' }
]
const argv = [ '--one', '1' ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
one: '1',
two: 'two'
})
})
runner.test('default value 2', function () {
const defs = [ { name: 'two', defaultValue: 'two' } ]
const argv = []
a.deepStrictEqual(commandLineArgs(defs, { argv }), { two: 'two' })
})
runner.test('default value 3', function () {
const defs = [ { name: 'two', defaultValue: 'two' } ]
const argv = [ '--two', 'zwei' ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), { two: 'zwei' })
})
runner.test('default value 4', function () {
const defs = [ { name: 'two', multiple: true, defaultValue: [ 'two', 'zwei' ] } ]
const argv = [ '--two', 'duo' ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), { two: [ 'duo' ] })
})
runner.test('default value 5', function () {
const defs = [
{ name: 'two', multiple: true, defaultValue: ['two', 'zwei'] }
]
const argv = []
const result = commandLineArgs(defs, { argv })
a.deepStrictEqual(result, { two: [ 'two', 'zwei' ] })
})
runner.test('default value: array as defaultOption', function () {
const defs = [
{ name: 'two', multiple: true, defaultValue: ['two', 'zwei'], defaultOption: true }
]
const argv = [ 'duo' ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), { two: [ 'duo' ] })
})
runner.test('default value: falsy default values', function () {
const defs = [
{ name: 'one', defaultValue: 0 },
{ name: 'two', defaultValue: false }
]
const argv = []
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
one: 0,
two: false
})
})
runner.test('default value: is arrayifed if multiple set', function () {
const defs = [
{ name: 'one', defaultValue: 0, multiple: true }
]
let argv = []
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
one: [ 0 ]
})
argv = [ '--one', '2' ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
one: [ '2' ]
})
})
runner.test('default value: combined with defaultOption', function () {
const defs = [
{ name: 'path', defaultOption: true, defaultValue: './' }
]
let argv = [ '--path', 'test' ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
path: 'test'
})
argv = [ 'test' ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
path: 'test'
})
argv = [ ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
path: './'
})
})
runner.test('default value: combined with multiple and defaultOption', function () {
const defs = [
{ name: 'path', multiple: true, defaultOption: true, defaultValue: './' }
]
let argv = [ '--path', 'test1', 'test2' ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
path: [ 'test1', 'test2' ]
})
argv = [ '--path', 'test' ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
path: [ 'test' ]
})
argv = [ 'test1', 'test2' ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
path: [ 'test1', 'test2' ]
})
argv = [ 'test' ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
path: [ 'test' ]
})
argv = [ ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
path: [ './' ]
})
})
runner.test('default value: array default combined with multiple and defaultOption', function () {
const defs = [
{ name: 'path', multiple: true, defaultOption: true, defaultValue: [ './' ] }
]
let argv = [ '--path', 'test1', 'test2' ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
path: [ 'test1', 'test2' ]
})
argv = [ '--path', 'test' ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
path: [ 'test' ]
})
argv = [ 'test1', 'test2' ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
path: [ 'test1', 'test2' ]
})
argv = [ 'test' ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
path: [ 'test' ]
})
argv = [ ]
a.deepStrictEqual(commandLineArgs(defs, { argv }), {
path: [ './' ]
})
})

View File

@ -0,0 +1,28 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('detect process.argv: should automatically remove first two argv items', function () {
process.argv = [ 'node', 'filename', '--one', 'eins' ]
a.deepStrictEqual(commandLineArgs({ name: 'one' }), {
one: 'eins'
})
})
runner.test('detect process.argv: should automatically remove first two argv items 2', function () {
process.argv = [ 'node', 'filename', '--one', 'eins' ]
a.deepStrictEqual(commandLineArgs({ name: 'one' }, { argv: process.argv }), {
one: 'eins'
})
})
runner.test('process.argv is left untouched', function () {
process.argv = [ 'node', 'filename', '--one', 'eins' ]
a.deepStrictEqual(commandLineArgs({ name: 'one' }), {
one: 'eins'
})
a.deepStrictEqual(process.argv, [ 'node', 'filename', '--one', 'eins' ])
})

View File

@ -0,0 +1,50 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('exceptions-already-set: long option', function () {
const optionDefinitions = [
{ name: 'one', type: Boolean }
]
const argv = [ '--one', '--one' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'ALREADY_SET' && err.optionName === 'one'
)
})
runner.test('exceptions-already-set: short option', function () {
const optionDefinitions = [
{ name: 'one', type: Boolean, alias: 'o' }
]
const argv = [ '--one', '-o' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'ALREADY_SET' && err.optionName === 'one'
)
})
runner.test('exceptions-already-set: --option=value', function () {
const optionDefinitions = [
{ name: 'one' }
]
const argv = [ '--one=1', '--one=1' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'ALREADY_SET' && err.optionName === 'one'
)
})
runner.test('exceptions-already-set: combined short option', function () {
const optionDefinitions = [
{ name: 'one', type: Boolean, alias: 'o' }
]
const argv = [ '-oo' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'ALREADY_SET' && err.optionName === 'one'
)
})

View File

@ -0,0 +1,131 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('err-invalid-definition: throws when no definition.name specified', function () {
const optionDefinitions = [
{ something: 'one' },
{ something: 'two' }
]
const argv = [ '--one', '--two' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'INVALID_DEFINITIONS'
)
})
runner.test('err-invalid-definition: throws if dev set a numeric alias', function () {
const optionDefinitions = [
{ name: 'colours', alias: '1' }
]
const argv = [ '--colours', 'red' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'INVALID_DEFINITIONS'
)
})
runner.test('err-invalid-definition: throws if dev set an alias of "-"', function () {
const optionDefinitions = [
{ name: 'colours', alias: '-' }
]
const argv = [ '--colours', 'red' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'INVALID_DEFINITIONS'
)
})
runner.test('err-invalid-definition: multi-character alias', function () {
const optionDefinitions = [
{ name: 'one', alias: 'aa' }
]
const argv = [ '--one', 'red' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'INVALID_DEFINITIONS'
)
})
runner.test('err-invalid-definition: invalid type values 1', function () {
const argv = [ '--one', 'something' ]
a.throws(
() => commandLineArgs([ { name: 'one', type: 'string' } ], { argv }),
err => err.name === 'INVALID_DEFINITIONS'
)
})
runner.test('err-invalid-definition: invalid type values 2', function () {
const argv = [ '--one', 'something' ]
a.throws(
() => commandLineArgs([ { name: 'one', type: 234 } ], { argv }),
err => err.name === 'INVALID_DEFINITIONS'
)
})
runner.test('err-invalid-definition: invalid type values 3', function () {
const argv = [ '--one', 'something' ]
a.throws(
() => commandLineArgs([ { name: 'one', type: {} } ], { argv }),
err => err.name === 'INVALID_DEFINITIONS'
)
})
runner.test('err-invalid-definition: invalid type values 4', function () {
const argv = [ '--one', 'something' ]
a.doesNotThrow(function () {
commandLineArgs([ { name: 'one', type: function () {} } ], { argv })
}, /invalid/i)
})
runner.test('err-invalid-definition: duplicate name', function () {
const optionDefinitions = [
{ name: 'colours' },
{ name: 'colours' }
]
const argv = [ '--colours', 'red' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'INVALID_DEFINITIONS'
)
})
runner.test('err-invalid-definition: duplicate alias', function () {
const optionDefinitions = [
{ name: 'one', alias: 'a' },
{ name: 'two', alias: 'a' }
]
const argv = [ '--one', 'red' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'INVALID_DEFINITIONS'
)
})
runner.test('err-invalid-definition: multiple defaultOption', function () {
const optionDefinitions = [
{ name: 'one', defaultOption: true },
{ name: 'two', defaultOption: true }
]
const argv = [ '--one', 'red' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'INVALID_DEFINITIONS'
)
})
runner.test('err-invalid-defaultOption: defaultOption on a Boolean type', function () {
const optionDefinitions = [
{ name: 'one', type: Boolean, defaultOption: true }
]
const argv = [ '--one', 'red' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'INVALID_DEFINITIONS'
)
})

View File

@ -0,0 +1,91 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('exceptions-unknowns: unknown option', function () {
const optionDefinitions = [
{ name: 'one', type: Number }
]
a.throws(
() => commandLineArgs(optionDefinitions, { argv: [ '--one', '--two' ] }),
err => err.name === 'UNKNOWN_OPTION' && err.optionName === '--two'
)
})
runner.test('exceptions-unknowns: 1 unknown option, 1 unknown value', function () {
const optionDefinitions = [
{ name: 'one', type: Number }
]
a.throws(
() => commandLineArgs(optionDefinitions, { argv: [ '--one', '2', '--two', 'two' ] }),
err => err.name === 'UNKNOWN_OPTION' && err.optionName === '--two'
)
})
runner.test('exceptions-unknowns: unknown alias', function () {
const optionDefinitions = [
{ name: 'one', type: Number }
]
a.throws(
() => commandLineArgs(optionDefinitions, { argv: [ '-a', '2' ] }),
err => err.name === 'UNKNOWN_OPTION' && err.optionName === '-a'
)
})
runner.test('exceptions-unknowns: unknown combined aliases', function () {
const optionDefinitions = [
{ name: 'one', type: Number }
]
a.throws(
() => commandLineArgs(optionDefinitions, { argv: [ '-sdf' ] }),
err => err.name === 'UNKNOWN_OPTION' && err.optionName === '-s'
)
})
runner.test('exceptions-unknowns: unknown value', function () {
const optionDefinitions = [
{ name: 'one' }
]
const argv = [ '--one', 'arg1', 'arg2' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'UNKNOWN_VALUE' && err.value === 'arg2'
)
})
runner.test('exceptions-unknowns: unknown value with singular defaultOption', function () {
const optionDefinitions = [
{ name: 'one', defaultOption: true }
]
const argv = [ 'arg1', 'arg2' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'UNKNOWN_VALUE' && err.value === 'arg2'
)
})
runner.test('exceptions-unknowns: no unknown value exception with multiple defaultOption', function () {
const optionDefinitions = [
{ name: 'one', defaultOption: true, multiple: true }
]
const argv = [ 'arg1', 'arg2' ]
a.doesNotThrow(() => {
commandLineArgs(optionDefinitions, { argv })
})
})
runner.test('exceptions-unknowns: non-multiple defaultOption should take first value 2', function () {
const optionDefinitions = [
{ name: 'file', defaultOption: true },
{ name: 'one', type: Boolean },
{ name: 'two', type: Boolean }
]
const argv = [ '--two', 'file1', '--one', 'file2' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'UNKNOWN_VALUE' && err.value === 'file2'
)
})

174
node_modules/command-line-args/test/grouping.js generated vendored Normal file
View File

@ -0,0 +1,174 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('groups', function () {
const definitions = [
{ name: 'one', group: 'a' },
{ name: 'two', group: 'a' },
{ name: 'three', group: 'b' }
]
const argv = [ '--one', '1', '--two', '2', '--three', '3' ]
const output = commandLineArgs(definitions, { argv })
a.deepStrictEqual(output, {
a: {
one: '1',
two: '2'
},
b: {
three: '3'
},
_all: {
one: '1',
two: '2',
three: '3'
}
})
})
runner.test('groups: multiple and _none', function () {
const definitions = [
{ name: 'one', group: ['a', 'f'] },
{ name: 'two', group: ['a', 'g'] },
{ name: 'three' }
]
a.deepStrictEqual(commandLineArgs(definitions, { argv: [ '--one', '1', '--two', '2', '--three', '3' ] }), {
a: {
one: '1',
two: '2'
},
f: {
one: '1'
},
g: {
two: '2'
},
_none: {
three: '3'
},
_all: {
one: '1',
two: '2',
three: '3'
}
})
})
runner.test('groups: nothing set', function () {
const definitions = [
{ name: 'one', group: 'a' },
{ name: 'two', group: 'a' },
{ name: 'three', group: 'b' }
]
const argv = [ ]
const output = commandLineArgs(definitions, { argv })
a.deepStrictEqual(output, {
a: {},
b: {},
_all: {}
})
})
runner.test('groups: nothing set with one ungrouped', function () {
const definitions = [
{ name: 'one', group: 'a' },
{ name: 'two', group: 'a' },
{ name: 'three' }
]
const argv = [ ]
const output = commandLineArgs(definitions, { argv })
a.deepStrictEqual(output, {
a: {},
_all: {}
})
})
runner.test('groups: two ungrouped, one set', function () {
const definitions = [
{ name: 'one', group: 'a' },
{ name: 'two', group: 'a' },
{ name: 'three' },
{ name: 'four' }
]
const argv = [ '--three', '3' ]
const output = commandLineArgs(definitions, { argv })
a.deepStrictEqual(output, {
a: {},
_all: { three: '3' },
_none: { three: '3' }
})
})
runner.test('groups: two ungrouped, both set', function () {
const definitions = [
{ name: 'one', group: 'a' },
{ name: 'two', group: 'a' },
{ name: 'three' },
{ name: 'four' }
]
const argv = [ '--three', '3', '--four', '4' ]
const output = commandLineArgs(definitions, { argv })
a.deepStrictEqual(output, {
a: {},
_all: { three: '3', four: '4' },
_none: { three: '3', four: '4' }
})
})
runner.test('groups: with partial', function () {
const definitions = [
{ name: 'one', group: 'a' },
{ name: 'two', group: 'a' },
{ name: 'three', group: 'b' }
]
const argv = [ '--one', '1', '--two', '2', '--three', '3', 'ham', '--cheese' ]
a.deepStrictEqual(commandLineArgs(definitions, { argv, partial: true }), {
a: {
one: '1',
two: '2'
},
b: {
three: '3'
},
_all: {
one: '1',
two: '2',
three: '3'
},
_unknown: [ 'ham', '--cheese' ]
})
})
runner.test('partial: with partial, multiple groups and _none', function () {
const definitions = [
{ name: 'one', group: ['a', 'f'] },
{ name: 'two', group: ['a', 'g'] },
{ name: 'three' }
]
const argv = [ '--cheese', '--one', '1', 'ham', '--two', '2', '--three', '3', '-c' ]
a.deepStrictEqual(commandLineArgs(definitions, { argv, partial: true }), {
a: {
one: '1',
two: '2'
},
f: {
one: '1'
},
g: {
two: '2'
},
_none: {
three: '3'
},
_all: {
one: '1',
two: '2',
three: '3'
},
_unknown: [ '--cheese', 'ham', '-c' ]
})
})

View File

@ -0,0 +1,366 @@
'use strict'
const TestRunner = require('test-runner')
const a = require('assert')
const runner = new TestRunner()
const ArgvParser = require('../../lib/argv-parser')
runner.test('argv-parser: long option, string', function () {
const optionDefinitions = [
{ name: 'one' }
]
const argv = [ '--one', '1' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(result[1].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'set', arg: '--one', name: 'one', value: null },
{ event: 'set', arg: '1', name: 'one', value: '1' }
])
})
runner.test('argv-parser: long option, string repeated', function () {
const optionDefinitions = [
{ name: 'one' }
]
const argv = [ '--one', '1', '--one', '2' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(result[1].def)
a.ok(result[2].def)
a.ok(result[3].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'set', arg: '--one', name: 'one', value: null },
{ event: 'set', arg: '1', name: 'one', value: '1' },
{ event: 'set', arg: '--one', name: 'one', value: null },
{ event: 'set', arg: '2', name: 'one', value: '2' }
])
})
runner.test('argv-parser: long option, string multiple', function () {
const optionDefinitions = [
{ name: 'one', multiple: true }
]
const argv = [ '--one', '1', '2' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(result[1].def)
a.ok(result[2].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'set', arg: '--one', name: 'one', value: null },
{ event: 'set', arg: '1', name: 'one', value: '1' },
{ event: 'set', arg: '2', name: 'one', value: '2' }
])
})
runner.test('argv-parser: long option, string multiple then boolean', function () {
const optionDefinitions = [
{ name: 'one', multiple: true },
{ name: 'two', type: Boolean }
]
const argv = [ '--one', '1', '2', '--two' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(result[1].def)
a.ok(result[2].def)
a.ok(result[3].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'set', arg: '--one', name: 'one', value: null },
{ event: 'set', arg: '1', name: 'one', value: '1' },
{ event: 'set', arg: '2', name: 'one', value: '2' },
{ event: 'set', arg: '--two', name: 'two', value: true }
])
})
runner.test('argv-parser: long option, boolean', function () {
const optionDefinitions = [
{ name: 'one', type: Boolean }
]
const argv = [ '--one', '1' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(!result[1].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'set', arg: '--one', name: 'one', value: true },
{ event: 'unknown_value', arg: '1', name: '_unknown', value: undefined }
])
})
runner.test('argv-parser: simple, with unknown values', function () {
const optionDefinitions = [
{ name: 'one', type: Number }
]
const argv = [ 'clive', '--one', '1', 'yeah' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(!result[0].def)
a.ok(result[1].def)
a.ok(result[2].def)
a.ok(!result[3].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'unknown_value', arg: 'clive', name: '_unknown', value: undefined },
{ event: 'set', arg: '--one', name: 'one', value: null },
{ event: 'set', arg: '1', name: 'one', value: '1' },
{ event: 'unknown_value', arg: 'yeah', name: '_unknown', value: undefined }
])
})
runner.test('argv-parser: simple, with singular defaultOption', function () {
const optionDefinitions = [
{ name: 'one', type: Number },
{ name: 'two', defaultOption: true }
]
const argv = [ 'clive', '--one', '1', 'yeah' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(result[1].def)
a.ok(result[2].def)
a.ok(!result[3].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'set', arg: 'clive', name: 'two', value: 'clive' },
{ event: 'set', arg: '--one', name: 'one', value: null },
{ event: 'set', arg: '1', name: 'one', value: '1' },
{ event: 'unknown_value', arg: 'yeah', name: '_unknown', value: undefined }
])
})
runner.test('argv-parser: simple, with multiple defaultOption', function () {
const optionDefinitions = [
{ name: 'one', type: Number },
{ name: 'two', defaultOption: true, multiple: true }
]
const argv = [ 'clive', '--one', '1', 'yeah' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(result[1].def)
a.ok(result[2].def)
a.ok(result[3].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'set', arg: 'clive', name: 'two', value: 'clive' },
{ event: 'set', arg: '--one', name: 'one', value: null },
{ event: 'set', arg: '1', name: 'one', value: '1' },
{ event: 'set', arg: 'yeah', name: 'two', value: 'yeah' }
])
})
runner.test('argv-parser: long option, string lazyMultiple bad', function () {
const optionDefinitions = [
{ name: 'one', lazyMultiple: true }
]
const argv = [ '--one', '1', '2' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(result[1].def)
a.ok(!result[2].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'set', arg: '--one', name: 'one', value: null },
{ event: 'set', arg: '1', name: 'one', value: '1' },
{ event: 'unknown_value', arg: '2', name: '_unknown', value: undefined }
])
})
runner.test('argv-parser: long option, string lazyMultiple good', function () {
const optionDefinitions = [
{ name: 'one', lazyMultiple: true }
]
const argv = [ '--one', '1', '--one', '2' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(result[1].def)
a.ok(result[2].def)
a.ok(result[3].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'set', arg: '--one', name: 'one', value: null },
{ event: 'set', arg: '1', name: 'one', value: '1' },
{ event: 'set', arg: '--one', name: 'one', value: null },
{ event: 'set', arg: '2', name: 'one', value: '2' }
])
})
runner.test('argv-parser: long option, stopAtFirstUnknown', function () {
const optionDefinitions = [
{ name: 'one' },
{ name: 'two' }
]
const argv = [ '--one', '1', 'asdf', '--two', '2' ]
const parser = new ArgvParser(optionDefinitions, { argv, stopAtFirstUnknown: true })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(result[1].def)
a.ok(!result[2].def)
a.ok(!result[3].def)
a.ok(!result[4].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'set', arg: '--one', name: 'one', value: null },
{ event: 'set', arg: '1', name: 'one', value: '1' },
{ event: 'unknown_value', arg: 'asdf', name: '_unknown', value: undefined },
{ event: 'unknown_value', arg: '--two', name: '_unknown', value: undefined },
{ event: 'unknown_value', arg: '2', name: '_unknown', value: undefined }
])
})
runner.test('argv-parser: long option, stopAtFirstUnknown with defaultOption', function () {
const optionDefinitions = [
{ name: 'one', defaultOption: true },
{ name: 'two' }
]
const argv = [ '1', 'asdf', '--two', '2' ]
const parser = new ArgvParser(optionDefinitions, { argv, stopAtFirstUnknown: true })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(!result[1].def)
a.ok(!result[2].def)
a.ok(!result[3].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'set', arg: '1', name: 'one', value: '1' },
{ event: 'unknown_value', arg: 'asdf', name: '_unknown', value: undefined },
{ event: 'unknown_value', arg: '--two', name: '_unknown', value: undefined },
{ event: 'unknown_value', arg: '2', name: '_unknown', value: undefined }
])
})
runner.test('argv-parser: long option, stopAtFirstUnknown with defaultOption 2', function () {
const optionDefinitions = [
{ name: 'one', defaultOption: true },
{ name: 'two' }
]
const argv = [ '--one', '1', '--', '--two', '2' ]
const parser = new ArgvParser(optionDefinitions, { argv, stopAtFirstUnknown: true })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(result[1].def)
a.ok(!result[2].def)
a.ok(!result[3].def)
a.ok(!result[4].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'set', arg: '--one', name: 'one', value: null },
{ event: 'set', arg: '1', name: 'one', value: '1' },
{ event: 'unknown_value', arg: '--', name: '_unknown', value: undefined },
{ event: 'unknown_value', arg: '--two', name: '_unknown', value: undefined },
{ event: 'unknown_value', arg: '2', name: '_unknown', value: undefined }
])
})
runner.test('argv-parser: --option=value', function () {
const optionDefinitions = [
{ name: 'one' },
{ name: 'two' }
]
const argv = [ '--one=1', '--two=2', '--two=' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(result[1].def)
a.ok(result[2].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'set', arg: '--one=1', name: 'one', value: '1' },
{ event: 'set', arg: '--two=2', name: 'two', value: '2' },
{ event: 'set', arg: '--two=', name: 'two', value: '' }
])
})
runner.test('argv-parser: --option=value, unknown option', function () {
const optionDefinitions = [
{ name: 'one' }
]
const argv = [ '--three=3' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(!result[0].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'unknown_option', arg: '--three=3', name: '_unknown', value: undefined }
])
})
runner.test('argv-parser: --option=value where option is boolean', function () {
const optionDefinitions = [
{ name: 'one', type: Boolean }
]
const argv = [ '--one=1' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(result[1].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'unknown_value', arg: '--one=1', name: '_unknown', value: undefined },
{ event: 'set', arg: '--one=1', name: 'one', value: true }
])
})
runner.test('argv-parser: short option, string', function () {
const optionDefinitions = [
{ name: 'one', alias: 'o' }
]
const argv = [ '-o', '1' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(result[1].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'set', arg: '-o', name: 'one', value: null },
{ event: 'set', arg: '1', name: 'one', value: '1' }
])
})
runner.test('argv-parser: combined short option, string', function () {
const optionDefinitions = [
{ name: 'one', alias: 'o' },
{ name: 'two', alias: 't' }
]
const argv = [ '-ot', '1' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(result[0].def)
a.ok(result[1].def)
a.ok(result[2].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'set', arg: '-ot', subArg: '-o', name: 'one', value: null },
{ event: 'set', arg: '-ot', subArg: '-t', name: 'two', value: null },
{ event: 'set', arg: '1', name: 'two', value: '1' }
])
})
runner.test('argv-parser: combined short option, one unknown', function () {
const optionDefinitions = [
{ name: 'one', alias: 'o' },
{ name: 'two', alias: 't' }
]
const argv = [ '-xt', '1' ]
const parser = new ArgvParser(optionDefinitions, { argv })
const result = Array.from(parser)
a.ok(!result[0].def)
a.ok(result[1].def)
a.ok(result[2].def)
result.forEach(r => delete r.def)
a.deepStrictEqual(result, [
{ event: 'unknown_option', arg: '-xt', subArg: '-x', name: '_unknown', value: undefined },
{ event: 'set', arg: '-xt', subArg: '-t', name: 'two', value: null },
{ event: 'set', arg: '1', name: 'two', value: '1' }
])
})

View File

@ -0,0 +1,35 @@
'use strict'
const TestRunner = require('test-runner')
const Option = require('../../lib/option')
const a = require('assert')
const runner = new TestRunner()
runner.test('option.set(): defaultValue', function () {
const option = new Option({ name: 'two', defaultValue: 'two' })
a.strictEqual(option.get(), 'two')
option.set('zwei')
a.strictEqual(option.get(), 'zwei')
})
runner.test('option.set(): multiple defaultValue', function () {
const option = new Option({ name: 'two', multiple: true, defaultValue: [ 'two', 'zwei' ] })
a.deepStrictEqual(option.get(), [ 'two', 'zwei' ])
option.set('duo')
a.deepStrictEqual(option.get(), [ 'duo' ])
})
runner.test('option.set(): falsy defaultValue', function () {
const option = new Option({ name: 'one', defaultValue: 0 })
a.strictEqual(option.get(), 0)
})
runner.test('option.set(): falsy defaultValue 2', function () {
const option = new Option({ name: 'two', defaultValue: false })
a.strictEqual(option.get(), false)
})
runner.test('option.set(): falsy defaultValue multiple', function () {
const option = new Option({ name: 'one', defaultValue: 0, multiple: true })
a.deepStrictEqual(option.get(), [ 0 ])
})

View File

@ -0,0 +1,28 @@
'use strict'
const TestRunner = require('test-runner')
const a = require('assert')
const Definitions = require('../../lib/option-definitions')
const runner = new TestRunner()
runner.test('.get(long option)', function () {
const definitions = Definitions.from([ { name: 'one' } ])
a.strictEqual(definitions.get('--one').name, 'one')
})
runner.test('.get(short option)', function () {
const definitions = Definitions.from([ { name: 'one', alias: 'o' } ])
a.strictEqual(definitions.get('-o').name, 'one')
})
runner.test('.get(name)', function () {
const definitions = Definitions.from([ { name: 'one' } ])
a.strictEqual(definitions.get('one').name, 'one')
})
runner.test('.validate()', function () {
a.throws(function () {
const definitions = new Definitions()
definitions.load([ { name: 'one' }, { name: 'one' } ])
})
})

View File

@ -0,0 +1,55 @@
'use strict'
const TestRunner = require('test-runner')
const FlagOption = require('../../lib/option-flag')
const a = require('assert')
const runner = new TestRunner()
runner.test('type-boolean: single set', function () {
const option = new FlagOption({ name: 'one', type: Boolean })
option.set(undefined)
a.strictEqual(option.get(), true)
})
runner.test('type-boolean: single set 2', function () {
const option = new FlagOption({ name: 'one', type: Boolean })
option.set('true')
a.strictEqual(option.get(), true)
})
runner.test('type-boolean: set twice', function () {
const option = new FlagOption({ name: 'one', type: Boolean })
option.set(undefined)
a.strictEqual(option.get(), true)
a.throws(
() => option.set('true'),
err => err.name === 'ALREADY_SET'
)
})
const origBoolean = Boolean
/* test in contexts which override the standard global Boolean constructor */
runner.test('type-boolean: global Boolean overridden', function () {
function Boolean () {
return origBoolean.apply(origBoolean, arguments)
}
const option = new FlagOption({ name: 'one', type: Boolean })
option.set()
a.strictEqual(option.get(), true)
})
runner.test('type-boolean-multiple: 1', function () {
const option = new FlagOption({ name: 'one', type: Boolean, multiple: true })
option.set(undefined)
option.set(undefined)
option.set(undefined)
a.deepStrictEqual(option.get(), [ true, true, true ])
})

View File

@ -0,0 +1,98 @@
'use strict'
const TestRunner = require('test-runner')
const Option = require('../../lib/option')
const a = require('assert')
const runner = new TestRunner()
runner.test('option.set(): simple set string', function () {
const option = Option.create({ name: 'two' })
a.strictEqual(option.get(), null)
a.strictEqual(option.state, 'default')
option.set('zwei')
a.strictEqual(option.get(), 'zwei')
a.strictEqual(option.state, 'set')
})
runner.test('option.set(): simple set boolean', function () {
const option = Option.create({ name: 'two', type: Boolean })
a.strictEqual(option.get(), null)
a.strictEqual(option.state, 'default')
option.set()
a.strictEqual(option.get(), true)
a.strictEqual(option.state, 'set')
})
runner.test('option.set(): simple set string twice', function () {
const option = Option.create({ name: 'two' })
a.strictEqual(option.get(), null)
a.strictEqual(option.state, 'default')
option.set('zwei')
a.strictEqual(option.get(), 'zwei')
a.strictEqual(option.state, 'set')
a.throws(
() => option.set('drei'),
err => err.name === 'ALREADY_SET'
)
})
runner.test('option.set(): simple set boolean twice', function () {
const option = Option.create({ name: 'two', type: Boolean })
a.strictEqual(option.get(), null)
a.strictEqual(option.state, 'default')
option.set()
a.strictEqual(option.get(), true)
a.strictEqual(option.state, 'set')
a.throws(
() => option.set(),
err => err.name === 'ALREADY_SET'
)
})
runner.test('option.set(): string multiple', function () {
const option = Option.create({ name: 'two', multiple: true })
a.deepStrictEqual(option.get(), [])
a.strictEqual(option.state, 'default')
option.set('1')
a.deepStrictEqual(option.get(), [ '1' ])
a.strictEqual(option.state, 'set')
option.set('2')
a.deepStrictEqual(option.get(), [ '1', '2' ])
a.strictEqual(option.state, 'set')
})
runner.test('option.set: lazyMultiple', function () {
const option = Option.create({ name: 'one', lazyMultiple: true })
a.deepStrictEqual(option.get(), [])
a.strictEqual(option.state, 'default')
option.set('1')
a.deepStrictEqual(option.get(), [ '1' ])
a.strictEqual(option.state, 'set')
option.set('2')
a.deepStrictEqual(option.get(), [ '1', '2' ])
a.strictEqual(option.state, 'set')
})
runner.test('option.set(): string multiple defaultOption', function () {
const option = Option.create({ name: 'two', multiple: true, defaultOption: true })
a.deepStrictEqual(option.get(), [])
a.strictEqual(option.state, 'default')
option.set('1')
a.deepStrictEqual(option.get(), [ '1' ])
a.strictEqual(option.state, 'set')
option.set('2')
a.deepStrictEqual(option.get(), [ '1', '2' ])
a.strictEqual(option.state, 'set')
})
runner.test('option.set: lazyMultiple defaultOption', function () {
const option = Option.create({ name: 'one', lazyMultiple: true, defaultOption: true })
a.deepStrictEqual(option.get(), [])
a.strictEqual(option.state, 'default')
option.set('1')
a.deepStrictEqual(option.get(), [ '1' ])
a.strictEqual(option.state, 'set')
option.set('2')
a.deepStrictEqual(option.get(), [ '1', '2' ])
a.strictEqual(option.state, 'set')
})

View File

@ -0,0 +1,26 @@
'use strict'
const TestRunner = require('test-runner')
const a = require('assert')
const Output = require('../../lib/output')
const runner = new TestRunner()
runner.test('output.toObject(): no defs set', function () {
const output = new Output([
{ name: 'one' }
])
a.deepStrictEqual(output.toObject(), {})
})
runner.test('output.toObject(): one def set', function () {
const output = new Output([
{ name: 'one' }
])
const Option = require('../../lib/option')
const option = Option.create({ name: 'one' })
option.set('yeah')
output.set('one', option)
a.deepStrictEqual(output.toObject(), {
one: 'yeah'
})
})

92
node_modules/command-line-args/test/multiple-lazy.js generated vendored Normal file
View File

@ -0,0 +1,92 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('lazy multiple: string', function () {
const argv = ['--one', 'a', '--one', 'b', '--one', 'd']
const optionDefinitions = [
{ name: 'one', lazyMultiple: true }
]
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, {
one: ['a', 'b', 'd']
})
})
runner.test('lazy multiple: string unset with defaultValue', function () {
const optionDefinitions = [
{ name: 'one', lazyMultiple: true, defaultValue: 1 }
]
const argv = []
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, { one: [ 1 ] })
})
runner.test('lazy multiple: string, --option=value', function () {
const optionDefinitions = [
{ name: 'one', lazyMultiple: true }
]
const argv = [ '--one=1', '--one=2' ]
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, {
one: [ '1', '2' ]
})
})
runner.test('lazy multiple: string, --option=value mix', function () {
const optionDefinitions = [
{ name: 'one', lazyMultiple: true }
]
const argv = [ '--one=1', '--one=2', '--one', '3' ]
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, {
one: [ '1', '2', '3' ]
})
})
runner.test('lazy multiple: string, defaultOption', function () {
const optionDefinitions = [
{ name: 'one', lazyMultiple: true, defaultOption: true }
]
const argv = [ '1', '2' ]
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, {
one: [ '1', '2' ]
})
})
runner.test('lazy multiple: greedy style, string', function () {
const optionDefinitions = [
{ name: 'one', lazyMultiple: true }
]
const argv = [ '--one', '1', '2' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'UNKNOWN_VALUE' && err.value === '2'
)
})
runner.test('lazy multiple: greedy style, string, --option=value', function () {
const optionDefinitions = [
{ name: 'one', lazyMultiple: true }
]
const argv = [ '--one=1', '--one=2' ]
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, {
one: [ '1', '2' ]
})
})
runner.test('lazy multiple: greedy style, string, --option=value mix', function () {
const optionDefinitions = [
{ name: 'one', lazyMultiple: true }
]
const argv = [ '--one=1', '--one=2', '3' ]
a.throws(
() => commandLineArgs(optionDefinitions, { argv }),
err => err.name === 'UNKNOWN_VALUE' && err.value === '3'
)
})

77
node_modules/command-line-args/test/multiple.js generated vendored Normal file
View File

@ -0,0 +1,77 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('multiple: empty argv', function () {
const optionDefinitions = [
{ name: 'one', multiple: true }
]
const argv = []
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, {})
})
runner.test('multiple: boolean, empty argv', function () {
const optionDefinitions = [
{ name: 'one', type: Boolean, multiple: true }
]
const argv = []
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, { })
})
runner.test('multiple: string unset with defaultValue', function () {
const optionDefinitions = [
{ name: 'one', multiple: true, defaultValue: 1 }
]
const argv = []
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, { one: [ 1 ] })
})
runner.test('multiple: string', function () {
const optionDefinitions = [
{ name: 'one', multiple: true }
]
const argv = [ '--one', '1', '2' ]
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, {
one: [ '1', '2' ]
})
})
runner.test('multiple: string, --option=value', function () {
const optionDefinitions = [
{ name: 'one', multiple: true }
]
const argv = [ '--one=1', '--one=2' ]
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, {
one: [ '1', '2' ]
})
})
runner.test('multiple: string, --option=value mix', function () {
const optionDefinitions = [
{ name: 'one', multiple: true }
]
const argv = [ '--one=1', '--one=2', '3' ]
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, {
one: [ '1', '2', '3' ]
})
})
runner.test('multiple: string, defaultOption', function () {
const optionDefinitions = [
{ name: 'one', multiple: true, defaultOption: true }
]
const argv = [ '1', '2' ]
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, {
one: [ '1', '2' ]
})
})

21
node_modules/command-line-args/test/name-alias-mix.js generated vendored Normal file
View File

@ -0,0 +1,21 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('name-alias-mix: one of each', function () {
const optionDefinitions = [
{ name: 'one', alias: 'o' },
{ name: 'two', alias: 't' },
{ name: 'three', alias: 'h' },
{ name: 'four', alias: 'f' }
]
const argv = [ '--one', '-t', '--three' ]
const result = commandLineArgs(optionDefinitions, { argv })
a.strictEqual(result.one, null)
a.strictEqual(result.two, null)
a.strictEqual(result.three, null)
a.strictEqual(result.four, undefined)
})

19
node_modules/command-line-args/test/name-unicode.js generated vendored Normal file
View File

@ -0,0 +1,19 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('name-unicode: unicode names and aliases are permitted', function () {
const optionDefinitions = [
{ name: 'один' },
{ name: '两' },
{ name: 'три', alias: 'т' }
]
const argv = [ '--один', '1', '--两', '2', '-т', '3' ]
const result = commandLineArgs(optionDefinitions, { argv })
a.strictEqual(result.один, '1')
a.strictEqual(result., '2')
a.strictEqual(result.три, '3')
})

54
node_modules/command-line-args/test/notations.js generated vendored Normal file
View File

@ -0,0 +1,54 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('getOpt short notation: two flags, one option', function () {
const optionDefinitions = [
{ name: 'flagA', alias: 'a' },
{ name: 'flagB', alias: 'b' },
{ name: 'three', alias: 'c' }
]
const argv = [ '-abc', 'yeah' ]
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv }), {
flagA: null,
flagB: null,
three: 'yeah'
})
})
runner.test('option=value notation: two plus a regular notation', function () {
const optionDefinitions = [
{ name: 'one' },
{ name: 'two' },
{ name: 'three' }
]
const argv = [ '--one=1', '--two', '2', '--three=3' ]
const result = commandLineArgs(optionDefinitions, { argv })
a.strictEqual(result.one, '1')
a.strictEqual(result.two, '2')
a.strictEqual(result.three, '3')
})
runner.test('option=value notation: value contains "="', function () {
const optionDefinitions = [
{ name: 'url' },
{ name: 'two' },
{ name: 'three' }
]
let result = commandLineArgs(optionDefinitions, { argv: [ '--url=my-url?q=123', '--two', '2', '--three=3' ] })
a.strictEqual(result.url, 'my-url?q=123')
a.strictEqual(result.two, '2')
a.strictEqual(result.three, '3')
result = commandLineArgs(optionDefinitions, { argv: [ '--url=my-url?q=123=1' ] })
a.strictEqual(result.url, 'my-url?q=123=1')
result = commandLineArgs({ name: 'my-url' }, { argv: [ '--my-url=my-url?q=123=1' ] })
a.strictEqual(result['my-url'], 'my-url?q=123=1')
})

219
node_modules/command-line-args/test/partial.js generated vendored Normal file
View File

@ -0,0 +1,219 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('partial: simple', function () {
const definitions = [
{ name: 'one', type: Boolean }
]
const argv = [ '--two', 'two', '--one', 'two' ]
const options = commandLineArgs(definitions, { argv, partial: true })
a.deepStrictEqual(options, {
one: true,
_unknown: [ '--two', 'two', 'two' ]
})
})
runner.test('partial: defaultOption', function () {
const definitions = [
{ name: 'files', type: String, defaultOption: true, multiple: true }
]
const argv = [ '--files', 'file1', '--one', 'file2' ]
const options = commandLineArgs(definitions, { argv, partial: true })
a.deepStrictEqual(options, {
files: [ 'file1', 'file2' ],
_unknown: [ '--one' ]
})
})
runner.test('defaultOption: floating args present but no defaultOption', function () {
const definitions = [
{ name: 'one', type: Boolean }
]
a.deepStrictEqual(
commandLineArgs(definitions, { argv: [ 'aaa', '--one', 'aaa', 'aaa' ], partial: true }),
{
one: true,
_unknown: [ 'aaa', 'aaa', 'aaa' ]
}
)
})
runner.test('partial: combined short option, both unknown', function () {
const definitions = [
{ name: 'one', alias: 'o' },
{ name: 'two', alias: 't' }
]
const argv = [ '-ab' ]
const options = commandLineArgs(definitions, { argv, partial: true })
a.deepStrictEqual(options, {
_unknown: [ '-a', '-b' ]
})
})
runner.test('partial: combined short option, one known, one unknown', function () {
const definitions = [
{ name: 'one', alias: 'o' },
{ name: 'two', alias: 't' }
]
const argv = [ '-ob' ]
const options = commandLineArgs(definitions, { argv, partial: true })
a.deepStrictEqual(options, {
one: null,
_unknown: [ '-b' ]
})
})
runner.test('partial: defaultOption with --option=value and combined short options', function () {
const definitions = [
{ name: 'files', type: String, defaultOption: true, multiple: true },
{ name: 'one', type: Boolean },
{ name: 'two', alias: 't', defaultValue: 2 }
]
const argv = [ 'file1', '--one', 'file2', '-t', '--two=3', 'file3', '-ab' ]
const options = commandLineArgs(definitions, { argv, partial: true })
a.deepStrictEqual(options, {
files: [ 'file1', 'file2', 'file3' ],
two: '3',
one: true,
_unknown: [ '-a', '-b' ]
})
})
runner.test('partial: defaultOption with value equal to defaultValue', function () {
const definitions = [
{ name: 'file', type: String, defaultOption: true, defaultValue: 'file1' }
]
const argv = [ 'file1', '--two=3', '--four', '5' ]
const options = commandLineArgs(definitions, { argv, partial: true })
a.deepStrictEqual(options, {
file: 'file1',
_unknown: [ '--two=3', '--four', '5' ]
})
})
runner.test('partial: string defaultOption can be set by argv once', function () {
const definitions = [
{ name: 'file', type: String, defaultOption: true, defaultValue: 'file1' }
]
const argv = [ '--file', '--file=file2', '--two=3', '--four', '5' ]
const options = commandLineArgs(definitions, { argv, partial: true })
a.deepStrictEqual(options, {
file: 'file2',
_unknown: [ '--two=3', '--four', '5' ]
})
})
runner.test('partial: string defaultOption can not be set by argv twice', function () {
const definitions = [
{ name: 'file', type: String, defaultOption: true, defaultValue: 'file1' }
]
const argv = [ '--file', '--file=file2', '--two=3', '--four', '5', 'file3' ]
const options = commandLineArgs(definitions, { argv, partial: true })
a.deepStrictEqual(options, {
file: 'file2',
_unknown: [ '--two=3', '--four', '5', 'file3' ]
})
})
runner.test('partial: defaultOption with value equal to defaultValue 3', function () {
const definitions = [
{ name: 'file', type: String, defaultOption: true, defaultValue: 'file1' }
]
const argv = [ 'file1', 'file2', '--two=3', '--four', '5' ]
const options = commandLineArgs(definitions, { argv, partial: true })
a.deepStrictEqual(options, {
file: 'file1',
_unknown: [ 'file2', '--two=3', '--four', '5' ]
})
})
runner.test('partial: multiple', function () {
const definitions = [
{ name: 'files', type: String, multiple: true }
]
const argv = [ 'file1', '--files', 'file2', '-t', '--two=3', 'file3', '-ab', '--files=file4' ]
const options = commandLineArgs(definitions, { argv, partial: true })
a.deepStrictEqual(options, {
files: [ 'file2', 'file4' ],
_unknown: [ 'file1', '-t', '--two=3', 'file3', '-a', '-b' ]
})
})
runner.test('unknown options: rejected defaultOption values end up in _unknown', function () {
const definitions = [
{ name: 'foo', type: String },
{ name: 'verbose', alias: 'v', type: Boolean },
{ name: 'libs', type: String, defaultOption: true }
]
const argv = [ '--foo', 'bar', '-v', 'libfn', '--libarg', 'val1', '-r' ]
const options = commandLineArgs(definitions, { argv, partial: true })
a.deepStrictEqual(options, {
foo: 'bar',
verbose: true,
libs: 'libfn',
_unknown: [ '--libarg', 'val1', '-r' ]
})
})
runner.test('partial: defaultOption with --option=value notation', function () {
const definitions = [
{ name: 'files', type: String, multiple: true, defaultOption: true }
]
const argv = [ 'file1', 'file2', '--unknown=something' ]
const options = commandLineArgs(definitions, { argv, partial: true })
a.deepStrictEqual(options, {
files: [ 'file1', 'file2' ],
_unknown: [ '--unknown=something' ]
})
})
runner.test('partial: defaultOption with --option=value notation 2', function () {
const definitions = [
{ name: 'files', type: String, multiple: true, defaultOption: true }
]
const argv = [ 'file1', 'file2', '--unknown=something', '--files', 'file3', '--files=file4' ]
const options = commandLineArgs(definitions, { argv, partial: true })
a.deepStrictEqual(options, {
files: [ 'file1', 'file2', 'file3', 'file4' ],
_unknown: [ '--unknown=something' ]
})
})
runner.test('partial: defaultOption with --option=value notation 3', function () {
const definitions = [
{ name: 'files', type: String, multiple: true, defaultOption: true }
]
const argv = [ '--unknown', 'file1', '--another', 'something', 'file2', '--unknown=something', '--files', 'file3', '--files=file4' ]
const options = commandLineArgs(definitions, { argv, partial: true })
a.deepStrictEqual(options, {
files: [ 'file1', 'something', 'file2', 'file3', 'file4' ],
_unknown: [ '--unknown', '--another', '--unknown=something' ]
})
})
runner.test('partial: mulitple unknowns with same name', function () {
const definitions = [
{ name: 'file' }
]
const argv = [ '--unknown', '--unknown=something', '--file=file1', '--unknown' ]
const options = commandLineArgs(definitions, { argv, partial: true })
a.deepStrictEqual(options, {
file: 'file1',
_unknown: [ '--unknown', '--unknown=something', '--unknown' ]
})
})
runner.test('defaultOption: single string', function () {
const optionDefinitions = [
{ name: 'files', defaultOption: true }
]
const argv = [ 'file1', 'file2' ]
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv, partial: true }), {
files: 'file1',
_unknown: [ 'file2' ]
})
})

View File

@ -0,0 +1,45 @@
'use strict'
const TestRunner = require('test-runner')
const a = require('assert')
const commandLineArgs = require('../')
const runner = new TestRunner()
runner.test('stopAtFirstUnknown', function () {
const optionDefinitions = [
{ name: 'one', type: Boolean },
{ name: 'two', type: Boolean }
]
const argv = [ '--one', 'a', '--two' ]
const result = commandLineArgs(optionDefinitions, { argv, stopAtFirstUnknown: true, partial: true })
a.deepStrictEqual(result, {
one: true,
_unknown: [ 'a', '--two' ]
})
})
runner.test('stopAtFirstUnknown: with a singlular defaultOption', function () {
const optionDefinitions = [
{ name: 'one', defaultOption: true },
{ name: 'two' }
]
const argv = [ '--one', '1', '--', '--two', '2' ]
const result = commandLineArgs(optionDefinitions, { argv, stopAtFirstUnknown: true })
a.deepStrictEqual(result, {
one: '1',
_unknown: [ '--', '--two', '2' ]
})
})
runner.test('stopAtFirstUnknown: with a singlular defaultOption and partial', function () {
const optionDefinitions = [
{ name: 'one', defaultOption: true },
{ name: 'two' }
]
const argv = [ '--one', '1', '--', '--two', '2' ]
const result = commandLineArgs(optionDefinitions, { argv, stopAtFirstUnknown: true, partial: true })
a.deepStrictEqual(result, {
one: '1',
_unknown: [ '--', '--two', '2' ]
})
})

46
node_modules/command-line-args/test/type-boolean.js generated vendored Normal file
View File

@ -0,0 +1,46 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('type-boolean: simple', function () {
const optionDefinitions = [
{ name: 'one', type: Boolean }
]
a.deepStrictEqual(
commandLineArgs(optionDefinitions, { argv: [ '--one' ] }),
{ one: true }
)
})
const origBoolean = Boolean
/* test in contexts which override the standard global Boolean constructor */
runner.test('type-boolean: global Boolean overridden', function () {
function Boolean () {
return origBoolean.apply(origBoolean, arguments)
}
const optionDefinitions = [
{ name: 'one', type: Boolean }
]
a.deepStrictEqual(
commandLineArgs(optionDefinitions, { argv: [ '--one' ] }),
{ one: true }
)
})
runner.test('type-boolean-multiple: 1', function () {
const optionDefinitions = [
{ name: 'array', type: Boolean, multiple: true }
]
const argv = [ '--array', '--array', '--array' ]
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, {
array: [ true, true, true ]
})
})

44
node_modules/command-line-args/test/type-none.js generated vendored Normal file
View File

@ -0,0 +1,44 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
const definitions = [
{ name: 'one' },
{ name: 'two' }
]
runner.test('name: no argv values', function () {
const argv = []
const result = commandLineArgs(definitions, { argv })
a.deepStrictEqual(result, {})
})
runner.test('name: just names, no values', function () {
const argv = [ '--one', '--two' ]
const result = commandLineArgs(definitions, { argv })
a.deepStrictEqual(result, {
one: null,
two: null
})
})
runner.test('name: just names, one value, one unpassed value', function () {
const argv = [ '--one', 'one', '--two' ]
const result = commandLineArgs(definitions, { argv })
a.deepStrictEqual(result, {
one: 'one',
two: null
})
})
runner.test('name: just names, two values', function () {
const argv = [ '--one', 'one', '--two', 'two' ]
const result = commandLineArgs(definitions, { argv })
a.deepStrictEqual(result, {
one: 'one',
two: 'two'
})
})

54
node_modules/command-line-args/test/type-number.js generated vendored Normal file
View File

@ -0,0 +1,54 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('type-number: different values', function () {
const optionDefinitions = [
{ name: 'one', type: Number }
]
a.deepStrictEqual(
commandLineArgs(optionDefinitions, { argv: [ '--one', '1' ] }),
{ one: 1 }
)
a.deepStrictEqual(
commandLineArgs(optionDefinitions, { argv: [ '--one' ] }),
{ one: null }
)
a.deepStrictEqual(
commandLineArgs(optionDefinitions, { argv: [ '--one', '-1' ] }),
{ one: -1 }
)
const result = commandLineArgs(optionDefinitions, { argv: [ '--one', 'asdf' ] })
a.ok(isNaN(result.one))
})
runner.test('number multiple: 1', function () {
const optionDefinitions = [
{ name: 'array', type: Number, multiple: true }
]
const argv = [ '--array', '1', '2', '3' ]
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, {
array: [ 1, 2, 3 ]
})
a.notDeepStrictEqual(result, {
array: [ '1', '2', '3' ]
})
})
runner.test('number multiple: 2', function () {
const optionDefinitions = [
{ name: 'array', type: Number, multiple: true }
]
const argv = [ '--array', '1', '--array', '2', '--array', '3' ]
const result = commandLineArgs(optionDefinitions, { argv })
a.deepStrictEqual(result, {
array: [ 1, 2, 3 ]
})
a.notDeepStrictEqual(result, {
array: [ '1', '2', '3' ]
})
})

65
node_modules/command-line-args/test/type-other.js generated vendored Normal file
View File

@ -0,0 +1,65 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('type-other: different values', function () {
const definitions = [
{
name: 'file',
type: function (file) {
return file
}
}
]
a.deepStrictEqual(
commandLineArgs(definitions, { argv: [ '--file', 'one.js' ] }),
{ file: 'one.js' }
)
a.deepStrictEqual(
commandLineArgs(definitions, { argv: [ '--file' ] }),
{ file: null }
)
})
runner.test('type-other: broken custom type function', function () {
const definitions = [
{
name: 'file',
type: function (file) {
lasdfjsfakn // eslint-disable-line
}
}
]
a.throws(function () {
commandLineArgs(definitions, { argv: [ '--file', 'one.js' ] })
})
})
runner.test('type-other-multiple: different values', function () {
const definitions = [
{
name: 'file',
multiple: true,
type: function (file) {
return file
}
}
]
a.deepStrictEqual(
commandLineArgs(definitions, { argv: [ '--file', 'one.js' ] }),
{ file: [ 'one.js' ] }
)
a.deepStrictEqual(
commandLineArgs(definitions, { argv: [ '--file', 'one.js', 'two.js' ] }),
{ file: [ 'one.js', 'two.js' ] }
)
a.deepStrictEqual(
commandLineArgs(definitions, { argv: [ '--file' ] }),
{ file: [] }
)
})

24
node_modules/command-line-args/test/type-string.js generated vendored Normal file
View File

@ -0,0 +1,24 @@
'use strict'
const TestRunner = require('test-runner')
const commandLineArgs = require('../')
const a = require('assert')
const runner = new TestRunner()
runner.test('type-string: different values', function () {
const optionDefinitions = [
{ name: 'one', type: String }
]
a.deepStrictEqual(
commandLineArgs(optionDefinitions, { argv: [ '--one', 'yeah' ] }),
{ one: 'yeah' }
)
a.deepStrictEqual(
commandLineArgs(optionDefinitions, { argv: [ '--one' ] }),
{ one: null }
)
a.deepStrictEqual(
commandLineArgs(optionDefinitions, { argv: [ '--one', '3' ] }),
{ one: '3' }
)
})

167
node_modules/epoll/History.md generated vendored Normal file
View File

@ -0,0 +1,167 @@
2.0.1 - Apr 02 2018
===================
* update dependencies (nan v2.10.0)
2.0.0 - Feb 25 2018
===================
* update dependencies (nan v2.9.2)
* fix deprecations
* drop support for node.js v0.10, v0.12, v5 and v7
1.0.2 - Dec 24 2017
===================
* don't suppress deprecated-declaration warnings
* nan 2.8.0
1.0.1 - Nov 04 2017
===================
* suppress deprecated-declaration warnings
* document node 9 support
1.0.0 - Oct 15 2017
===================
* update dependencies (bindings v1.3.0, nan v2.7.0)
* document supported node versions
0.1.22 - Jun 18 2017
====================
* nan 2.6.2
0.1.21 - Feb 12 2017
====================
* require node v0.10 or higher
* nan 2.5.1
0.1.20 - Jul 22 2016
====================
* document dependency on Linux
* nan 2.4.0
0.1.19 - May 03 2016
====================
* add accessor for closed property to instance template
0.1.18 - Apr 27 2016
====================
* upgrade to NAN v2.3.2 for Node.js v6.0.0 compatability
0.1.17 - Jan 29 2016
====================
* nan 2.2.0
* documentation
0.1.16 - Oct 10 2015
====================
* documentation
* nan 2.1.0
0.1.15 - Aug 24 2015
====================
* fix null passed to callback
0.1.14 - Aug 24 2015
====================
* nan2 migration
0.1.13 - May 07 2015
====================
* io.js v2.0.0+ compatibility [#13](https://github.com/fivdi/epoll/issues/13)
0.1.12 - Feb 10 2015
====================
* nan 1.6.2
* refactored interrupts-per-second example [#11](https://github.com/fivdi/epoll/issues/11)
0.1.11 - Jan 17 2015
====================
* support io.js [#10](https://github.com/fivdi/epoll/issues/10)
0.1.10 - Nov 02 2014
====================
* nan 1.4.0
0.1.9 - Aug 09 2014
===================
* nan 1.3.0
0.1.8 - Jul 12 2014
===================
* nan 1.2.0
* bindings 1.2.1
0.1.7 - May 29 2014
===================
* Fixed date in History.md
0.1.6 - May 29 2014
===================
* Replace NanSymbol with NanNew<v8:String> [#9](https://github.com/fivdi/epoll/issues/9)
0.1.5 - May 04 2014
===================
* nan 1.0.0 alignment [#8](https://github.com/fivdi/epoll/issues/8)
0.1.4 - Apr 18 2014
===================
* Documented BeagleBone Ångström prerequisites
* Use bindings for laoding
0.1.3 - Mar 23 2014
===================
* 0.11.5+ compatibility [#7](https://github.com/fivdi/epoll/issues/7)
* Updated dependencies: nan 0.6.2 -> 0.8.0
0.1.2 - Nov 21 2013
===================
* 0.11.9+ compatibility [#6](https://github.com/fivdi/epoll/issues/6)
* Updated dependencies: nan 0.5.2 -> 0.6.0
0.1.1 - Nov 19 2013
===================
* A hopefully successfull attempt to fix an npm install issue
0.1.0 - Nov 18 2013
===================
* Updated dependencies: nan 0.4.1 -> 0.5.2
* removed using namespace v8 (bad practice)
0.0.8 - Oct 14 2013
===================
* Epoll thread code improved (#4)
* EINTR handling (#3)
0.0.7 - Oct 05 2013
===================
* closed property added (#1)
* Segfault issue fixed (#5)
* add and modify now accept Epoll.EPOLLET as an event (#2)
0.0.6 - Oct 01 2013
===================
* Example for watching outputs added
* Tests improved
0.0.5 - Sep 25 2013
===================
* Link removed from readme
0.0.4 - Sep 25 2013
===================
* Url in readme fixed so that it displays correctly at npmjs.org, hopefully
0.0.3 - Sep 25 2013
===================
* Content added to readme
* Examples for the BeagleBone and RaspberryPi
* Minor bug fixes
* Tests improved
0.0.2 - Sep 22 2013
===================
* Tests extended and improved
* Allow installation on non-Linux systems but provide no functionality (needed for firmata-pi tests)
0.0.1 - Sep 22 2013
===================
* Initial release

20
node_modules/epoll/LICENSE generated vendored Normal file
View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2013 fivdi
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 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.

256
node_modules/epoll/README.md generated vendored Normal file
View File

@ -0,0 +1,256 @@
# epoll
A low-level **Node.js** binding for the Linux epoll API for monitoring multiple
file descriptors to see if I/O is possible on any of them.
This module was initially written to detect EPOLLPRI events indicating that
urgent data is available for reading. EPOLLPRI events are triggered by
interrupt generating [GPIO](https://www.kernel.org/doc/Documentation/gpio/)
pins. The epoll module is used by [onoff](https://github.com/fivdi/onoff)
to detect such interrupts.
epoll supports Node.js versions 4, 6, 8 and 9.
## Installation
Note that epoll can only be installed successfully on Linux systems. Attempting
to install epoll on other systems will result in compile errors.
```
npm install epoll
```
## API
* Epoll(callback) - Constructor. The callback is called when epoll events
occur and it gets three arguments (err, fd, events).
* add(fd, events) - Register file descriptor fd for the event types specified
by events.
* remove(fd) - Deregister file descriptor fd.
* modify(fd, events) - Change the event types associated with file descriptor
fd to those specified by events.
* close() - Deregisters all file descriptors and free resources.
Event Types
* Epoll.EPOLLIN
* Epoll.EPOLLOUT
* Epoll.EPOLLRDHUP
* Epoll.EPOLLPRI
* Epoll.EPOLLERR
* Epoll.EPOLLHUP
* Epoll.EPOLLET
* Epoll.EPOLLONESHOT
Event types can be combined with | when calling add or modify. For example,
Epoll.EPOLLPRI | Epoll.EPOLLONESHOT could be passed to add to detect a single
GPIO interrupt.
## Example - Watching Buttons
The following example shows how epoll can be used to detect interrupts from a
momentary push-button connected to GPIO #4 (pin P1-7) on the Raspberry Pi.
The source code is available in the
[example directory](https://github.com/fivdi/epoll/tree/master/example/watch-button)
and can easily be modified for using a different GPIO on the Pi or a different
platform such as the BeagleBone.
The first step is to export GPIO #4 as an interrupt generating input using
the export bash script from the examples directory.
```
./export
```
export:
```bash
#!/bin/sh
echo 4 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio4/direction
echo both > /sys/class/gpio/gpio4/edge
```
Then run watch-button to be notified every time the button is pressed and
released. If there is no hardware debounce circuit for the push-button, contact
bounce issues are very likely to be visible on the console output.
watch-button terminates automatically after 30 seconds.
```
node watch-button
```
watch-button:
```js
var Epoll = require('../../build/Release/epoll').Epoll,
fs = require('fs'),
valuefd = fs.openSync('/sys/class/gpio/gpio4/value', 'r'),
buffer = new Buffer(1);
// Create a new Epoll. The callback is the interrupt handler.
var poller = new Epoll(function (err, fd, events) {
// Read GPIO value file. Reading also clears the interrupt.
fs.readSync(fd, buffer, 0, 1, 0);
console.log(buffer.toString() === '1' ? 'released' : 'pressed');
});
// Read the GPIO value file before watching to
// prevent an initial unauthentic interrupt.
fs.readSync(valuefd, buffer, 0, 1, 0);
// Start watching for interrupts.
poller.add(valuefd, Epoll.EPOLLPRI);
// Stop watching after 30 seconds.
setTimeout(function () {
poller.remove(valuefd).close();
}, 30000);
```
When watch-button has terminated, GPIO #4 can be unexported using the
unexport bash script.
```
./unexport
```
unexport:
```bash
#!/bin/sh
echo 4 > /sys/class/gpio/unexport
```
## Example - Interrupts Per Second
The following example shows how epoll can be used to determine the number of
hardware interrupts that can be handled per second on the Raspberry Pi.
The source code is available in the
[example directory](https://github.com/fivdi/epoll/tree/master/example/interrupts-per-second)
and can easily be modified to use different GPIOs on the Raspberry Pi or a
different platform such as the BeagleBone.
In this example, GPIO #7 is wired to one end of a 1kΩ current limiting
resistor and GPIO #8 is wired to the other end of the resistor. GPIO #7 is an
input and GPIO #8 is an output.
The first step is to export GPIOs #7 and #8 using the export bash script from
the examples directory.
```
./export
```
export:
```bash
#!/bin/sh
echo 7 > /sys/class/gpio/export
echo 8 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio7/direction
echo both > /sys/class/gpio/gpio7/edge
echo out > /sys/class/gpio/gpio8/direction
```
Then run interrupts-per-second. interrupts-per-second toggles the state of the
output every time it detects an interrupt on the input. Each toggle will
trigger the next interrupt. After five seconds, interrupts-per-second prints
the number of interrupts it detected per second.
```
node interrupts-per-second
```
interrupts-per-second:
```js
var Epoll = require('../../build/Release/epoll').Epoll,
fs = require('fs'),
inputfd = fs.openSync('/sys/class/gpio/gpio7/value', 'r+'),
outputfd = fs.openSync('/sys/class/gpio/gpio8/value', 'r+'),
value = new Buffer(1), // The three Buffers here are global
zero = new Buffer('0'), // to improve performance.
one = new Buffer('1'),
count = 0,
time;
// Create a new Epoll. The callback is the interrupt handler.
var poller = new Epoll(function (err, fd, events) {
var nextValue;
count++;
// Read GPIO value file. Reading also clears the interrupt.
fs.readSync(inputfd, value, 0, 1, 0);
// Toggle GPIO value. This will eventually result
// in the next interrupt being triggered.
nextValue = value[0] === zero[0] ? one : zero;
fs.writeSync(outputfd, nextValue, 0, nextValue.length, 0);
});
time = process.hrtime(); // Get start time.
// Start watching for interrupts. This will trigger the first interrupt
// as the value file already has data waiting for a read.
poller.add(inputfd, Epoll.EPOLLPRI);
// Print interrupt rate to console after 5 seconds.
setTimeout(function () {
var rate;
time = process.hrtime(time); // Get run time.
rate = Math.floor(count / (time[0] + time[1] / 1E9));
console.log(rate + ' interrupts per second');
// Stop watching.
poller.remove(inputfd).close();
}, 5000);
```
When interrupts-per-second has terminated, GPIOs #7 and #8 can be unexported
using the unexport bash script.
```
./unexport
```
unexport:
```bash
#!/bin/sh
echo 7 > /sys/class/gpio/unexport
echo 8 > /sys/class/gpio/unexport
```
Here are some results from the "Interrupts Per Second" example.
**BeagleBone, 720MHz, Ångström v2012.12, Kernel 3.8.13, epoll v0.0.6:**
Node.js | Interrupts / Second
:---: | ---:
v0.11.7 | 7152
v0.10.20 | 5861
v0.8.22 | 6098
**BeagleBone Black, 1GHz, Debian, Kernel 3.8.13, epoll v0.1.11:**
Node.js | Interrupts / Second
:---: | ---:
v0.10.25 | 9133
**Raspberry Pi, 700Mhz, Raspbian, Kernel 3.2.27+, epoll v0.0.6:**
Node.js | Interrupts / Second
:---: | ---:
v0.11.07 | 4071
v0.10.16 | 3530
v0.8.14 | 3591
**Raspberry Pi 2, 900Mhz, Raspbian, Kernel 3.18.5-v7+, epoll v0.1.11:**
Node.js | Interrupts / Second
:---: | ---:
v0.10.36 | 10438

19
node_modules/epoll/binding.gyp generated vendored Normal file
View File

@ -0,0 +1,19 @@
{
"targets": [{
"target_name": "epoll",
"conditions": [[
"OS == \"linux\"", {
"cflags": [
"-Wno-unused-local-typedefs"
]
}]
],
"include_dirs" : [
"<!(node -e \"require('nan')\")"
],
"sources": [
"./src/epoll.cc"
]
}]
}

324
node_modules/epoll/build/Makefile generated vendored Normal file
View File

@ -0,0 +1,324 @@
# We borrow heavily from the kernel build setup, though we are simpler since
# we don't have Kconfig tweaking settings on us.
# The implicit make rules have it looking for RCS files, among other things.
# We instead explicitly write all the rules we care about.
# It's even quicker (saves ~200ms) to pass -r on the command line.
MAKEFLAGS=-r
# The source directory tree.
srcdir := ..
abs_srcdir := $(abspath $(srcdir))
# The name of the builddir.
builddir_name ?= .
# The V=1 flag on command line makes us verbosely print command lines.
ifdef V
quiet=
else
quiet=quiet_
endif
# Specify BUILDTYPE=Release on the command line for a release build.
BUILDTYPE ?= Release
# Directory all our build output goes into.
# Note that this must be two directories beneath src/ for unit tests to pass,
# as they reach into the src/ directory for data with relative paths.
builddir ?= $(builddir_name)/$(BUILDTYPE)
abs_builddir := $(abspath $(builddir))
depsdir := $(builddir)/.deps
# Object output directory.
obj := $(builddir)/obj
abs_obj := $(abspath $(obj))
# We build up a list of every single one of the targets so we can slurp in the
# generated dependency rule Makefiles in one pass.
all_deps :=
CC.target ?= $(CC)
CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS)
CXX.target ?= $(CXX)
CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS)
LINK.target ?= $(LINK)
LDFLAGS.target ?= $(LDFLAGS)
AR.target ?= $(AR)
# C++ apps need to be linked with g++.
LINK ?= $(CXX.target)
# TODO(evan): move all cross-compilation logic to gyp-time so we don't need
# to replicate this environment fallback in make as well.
CC.host ?= gcc
CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host)
CXX.host ?= g++
CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host)
LINK.host ?= $(CXX.host)
LDFLAGS.host ?=
AR.host ?= ar
# Define a dir function that can handle spaces.
# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions
# "leading spaces cannot appear in the text of the first argument as written.
# These characters can be put into the argument value by variable substitution."
empty :=
space := $(empty) $(empty)
# http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces
replace_spaces = $(subst $(space),?,$1)
unreplace_spaces = $(subst ?,$(space),$1)
dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1)))
# Flags to make gcc output dependency info. Note that you need to be
# careful here to use the flags that ccache and distcc can understand.
# We write to a dep file on the side first and then rename at the end
# so we can't end up with a broken dep file.
depfile = $(depsdir)/$(call replace_spaces,$@).d
DEPFLAGS = -MMD -MF $(depfile).raw
# We have to fixup the deps output in a few ways.
# (1) the file output should mention the proper .o file.
# ccache or distcc lose the path to the target, so we convert a rule of
# the form:
# foobar.o: DEP1 DEP2
# into
# path/to/foobar.o: DEP1 DEP2
# (2) we want missing files not to cause us to fail to build.
# We want to rewrite
# foobar.o: DEP1 DEP2 \
# DEP3
# to
# DEP1:
# DEP2:
# DEP3:
# so if the files are missing, they're just considered phony rules.
# We have to do some pretty insane escaping to get those backslashes
# and dollar signs past make, the shell, and sed at the same time.
# Doesn't work with spaces, but that's fine: .d files have spaces in
# their names replaced with other characters.
define fixup_dep
# The depfile may not exist if the input file didn't have any #includes.
touch $(depfile).raw
# Fixup path as in (1).
sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile)
# Add extra rules as in (2).
# We remove slashes and replace spaces with new lines;
# remove blank lines;
# delete the first line and append a colon to the remaining lines.
sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\
grep -v '^$$' |\
sed -e 1d -e 's|$$|:|' \
>> $(depfile)
rm $(depfile).raw
endef
# Command definitions:
# - cmd_foo is the actual command to run;
# - quiet_cmd_foo is the brief-output summary of the command.
quiet_cmd_cc = CC($(TOOLSET)) $@
cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $<
quiet_cmd_cxx = CXX($(TOOLSET)) $@
cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<
quiet_cmd_touch = TOUCH $@
cmd_touch = touch $@
quiet_cmd_copy = COPY $@
# send stderr to /dev/null to ignore messages when linking directories.
cmd_copy = rm -rf "$@" && cp -af "$<" "$@"
quiet_cmd_alink = AR($(TOOLSET)) $@
cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
quiet_cmd_alink_thin = AR($(TOOLSET)) $@
cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
# Due to circular dependencies between libraries :(, we wrap the
# special "figure out circular dependencies" flags around the entire
# input list during linking.
quiet_cmd_link = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)
# We support two kinds of shared objects (.so):
# 1) shared_library, which is just bundling together many dependent libraries
# into a link line.
# 2) loadable_module, which is generating a module intended for dlopen().
#
# They differ only slightly:
# In the former case, we want to package all dependent code into the .so.
# In the latter case, we want to package just the API exposed by the
# outermost module.
# This means shared_library uses --whole-archive, while loadable_module doesn't.
# (Note that --whole-archive is incompatible with the --start-group used in
# normal linking.)
# Other shared-object link notes:
# - Set SONAME to the library filename so our binaries don't reference
# the local, absolute paths used on the link command-line.
quiet_cmd_solink = SOLINK($(TOOLSET)) $@
cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)
quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)
# Define an escape_quotes function to escape single quotes.
# This allows us to handle quotes properly as long as we always use
# use single quotes and escape_quotes.
escape_quotes = $(subst ','\'',$(1))
# This comment is here just to include a ' to unconfuse syntax highlighting.
# Define an escape_vars function to escape '$' variable syntax.
# This allows us to read/write command lines with shell variables (e.g.
# $LD_LIBRARY_PATH), without triggering make substitution.
escape_vars = $(subst $$,$$$$,$(1))
# Helper that expands to a shell command to echo a string exactly as it is in
# make. This uses printf instead of echo because printf's behaviour with respect
# to escape sequences is more portable than echo's across different shells
# (e.g., dash, bash).
exact_echo = printf '%s\n' '$(call escape_quotes,$(1))'
# Helper to compare the command we're about to run against the command
# we logged the last time we ran the command. Produces an empty
# string (false) when the commands match.
# Tricky point: Make has no string-equality test function.
# The kernel uses the following, but it seems like it would have false
# positives, where one string reordered its arguments.
# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
# $(filter-out $(cmd_$@), $(cmd_$(1))))
# We instead substitute each for the empty string into the other, and
# say they're equal if both substitutions produce the empty string.
# .d files contain ? instead of spaces, take that into account.
command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\
$(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1))))
# Helper that is non-empty when a prerequisite changes.
# Normally make does this implicitly, but we force rules to always run
# so we can check their command lines.
# $? -- new prerequisites
# $| -- order-only dependencies
prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?))
# Helper that executes all postbuilds until one fails.
define do_postbuilds
@E=0;\
for p in $(POSTBUILDS); do\
eval $$p;\
E=$$?;\
if [ $$E -ne 0 ]; then\
break;\
fi;\
done;\
if [ $$E -ne 0 ]; then\
rm -rf "$@";\
exit $$E;\
fi
endef
# do_cmd: run a command via the above cmd_foo names, if necessary.
# Should always run for a given target to handle command-line changes.
# Second argument, if non-zero, makes it do asm/C/C++ dependency munging.
# Third argument, if non-zero, makes it do POSTBUILDS processing.
# Note: We intentionally do NOT call dirx for depfile, since it contains ? for
# spaces already and dirx strips the ? characters.
define do_cmd
$(if $(or $(command_changed),$(prereq_changed)),
@$(call exact_echo, $($(quiet)cmd_$(1)))
@mkdir -p "$(call dirx,$@)" "$(dir $(depfile))"
$(if $(findstring flock,$(word 1,$(cmd_$1))),
@$(cmd_$(1))
@echo " $(quiet_cmd_$(1)): Finished",
@$(cmd_$(1))
)
@$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile)
@$(if $(2),$(fixup_dep))
$(if $(and $(3), $(POSTBUILDS)),
$(call do_postbuilds)
)
)
endef
# Declare the "all" target first so it is the default,
# even though we don't have the deps yet.
.PHONY: all
all:
# make looks for ways to re-generate included makefiles, but in our case, we
# don't have a direct way. Explicitly telling make that it has nothing to do
# for them makes it go faster.
%.d: ;
# Use FORCE_DO_CMD to force a target to run. Should be coupled with
# do_cmd.
.PHONY: FORCE_DO_CMD
FORCE_DO_CMD:
TOOLSET := target
# Suffix rules, putting all outputs into $(obj).
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD
@$(call do_cmd,cc,1)
# Try building from generated source, too.
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD
@$(call do_cmd,cc,1)
ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
$(findstring $(join ^,$(prefix)),\
$(join ^,epoll.target.mk)))),)
include epoll.target.mk
endif
quiet_cmd_regen_makefile = ACTION Regenerating $@
cmd_regen_makefile = cd $(srcdir); /usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/home/wn/workspace-node/PiAlive/node_modules/epoll/build/config.gypi -I/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/home/wn/.node-gyp/8.11.1/include/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/home/wn/.node-gyp/8.11.1" "-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/home/wn/.node-gyp/8.11.1/<(target_arch)/node.lib" "-Dmodule_root_dir=/home/wn/workspace-node/PiAlive/node_modules/epoll" "-Dnode_engine=v8" binding.gyp
Makefile: $(srcdir)/../../../../.node-gyp/8.11.1/include/node/common.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../../usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi
$(call do_cmd,regen_makefile)
# "all" is a concatenation of the "all" targets from all the included
# sub-makefiles. This is just here to clarify.
all:
# Add in dependency-tracking rules. $(all_deps) is the list of every single
# target in our tree. Only consider the ones with .d (dependency) info:
d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d))
ifneq ($(d_files),)
include $(d_files)
endif

View File

@ -0,0 +1 @@
cmd_Release/epoll.node := rm -rf "Release/epoll.node" && cp -af "Release/obj.target/epoll.node" "Release/epoll.node"

View File

@ -0,0 +1 @@
cmd_Release/obj.target/epoll.node := g++ -shared -pthread -rdynamic -m64 -Wl,-soname=epoll.node -o Release/obj.target/epoll.node -Wl,--start-group Release/obj.target/epoll/src/epoll.o -Wl,--end-group

View File

@ -0,0 +1,56 @@
cmd_Release/obj.target/epoll/src/epoll.o := g++ '-DNODE_GYP_MODULE_NAME=epoll' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/wn/.node-gyp/8.11.1/include/node -I/home/wn/.node-gyp/8.11.1/src -I/home/wn/.node-gyp/8.11.1/deps/uv/include -I/home/wn/.node-gyp/8.11.1/deps/v8/include -I../../nan -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -Wno-unused-local-typedefs -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF ./Release/.deps/Release/obj.target/epoll/src/epoll.o.d.raw -c -o Release/obj.target/epoll/src/epoll.o ../src/epoll.cc
Release/obj.target/epoll/src/epoll.o: ../src/epoll.cc \
/home/wn/.node-gyp/8.11.1/include/node/uv.h \
/home/wn/.node-gyp/8.11.1/include/node/uv-errno.h \
/home/wn/.node-gyp/8.11.1/include/node/uv-version.h \
/home/wn/.node-gyp/8.11.1/include/node/uv-unix.h \
/home/wn/.node-gyp/8.11.1/include/node/uv-threadpool.h \
/home/wn/.node-gyp/8.11.1/include/node/uv-linux.h \
/home/wn/.node-gyp/8.11.1/include/node/v8.h \
/home/wn/.node-gyp/8.11.1/include/node/v8-version.h \
/home/wn/.node-gyp/8.11.1/include/node/v8config.h \
/home/wn/.node-gyp/8.11.1/include/node/node.h \
/home/wn/.node-gyp/8.11.1/include/node/v8.h \
/home/wn/.node-gyp/8.11.1/include/node/node_version.h \
/home/wn/.node-gyp/8.11.1/include/node/node_object_wrap.h \
/home/wn/.node-gyp/8.11.1/include/node/node_version.h ../../nan/nan.h \
/home/wn/.node-gyp/8.11.1/include/node/node_buffer.h \
/home/wn/.node-gyp/8.11.1/include/node/node.h ../../nan/nan_callbacks.h \
../../nan/nan_callbacks_12_inl.h ../../nan/nan_maybe_43_inl.h \
../../nan/nan_converters.h ../../nan/nan_converters_43_inl.h \
../../nan/nan_new.h ../../nan/nan_implementation_12_inl.h \
../../nan/nan_persistent_12_inl.h ../../nan/nan_weak.h \
../../nan/nan_object_wrap.h ../../nan/nan_private.h \
../../nan/nan_typedarray_contents.h ../../nan/nan_json.h ../src/epoll.h
../src/epoll.cc:
/home/wn/.node-gyp/8.11.1/include/node/uv.h:
/home/wn/.node-gyp/8.11.1/include/node/uv-errno.h:
/home/wn/.node-gyp/8.11.1/include/node/uv-version.h:
/home/wn/.node-gyp/8.11.1/include/node/uv-unix.h:
/home/wn/.node-gyp/8.11.1/include/node/uv-threadpool.h:
/home/wn/.node-gyp/8.11.1/include/node/uv-linux.h:
/home/wn/.node-gyp/8.11.1/include/node/v8.h:
/home/wn/.node-gyp/8.11.1/include/node/v8-version.h:
/home/wn/.node-gyp/8.11.1/include/node/v8config.h:
/home/wn/.node-gyp/8.11.1/include/node/node.h:
/home/wn/.node-gyp/8.11.1/include/node/v8.h:
/home/wn/.node-gyp/8.11.1/include/node/node_version.h:
/home/wn/.node-gyp/8.11.1/include/node/node_object_wrap.h:
/home/wn/.node-gyp/8.11.1/include/node/node_version.h:
../../nan/nan.h:
/home/wn/.node-gyp/8.11.1/include/node/node_buffer.h:
/home/wn/.node-gyp/8.11.1/include/node/node.h:
../../nan/nan_callbacks.h:
../../nan/nan_callbacks_12_inl.h:
../../nan/nan_maybe_43_inl.h:
../../nan/nan_converters.h:
../../nan/nan_converters_43_inl.h:
../../nan/nan_new.h:
../../nan/nan_implementation_12_inl.h:
../../nan/nan_persistent_12_inl.h:
../../nan/nan_weak.h:
../../nan/nan_object_wrap.h:
../../nan/nan_private.h:
../../nan/nan_typedarray_contents.h:
../../nan/nan_json.h:
../src/epoll.h:

BIN
node_modules/epoll/build/Release/epoll.node generated vendored Executable file

Binary file not shown.

BIN
node_modules/epoll/build/Release/obj.target/epoll.node generated vendored Executable file

Binary file not shown.

Binary file not shown.

6
node_modules/epoll/build/binding.Makefile generated vendored Normal file
View File

@ -0,0 +1,6 @@
# This file is generated by gyp; do not edit.
export builddir_name ?= ./build/.
.PHONY: all
all:
$(MAKE) epoll

186
node_modules/epoll/build/config.gypi generated vendored Normal file
View File

@ -0,0 +1,186 @@
# Do not edit. File was generated by node-gyp's "configure" step
{
"target_defaults": {
"cflags": [],
"default_configuration": "Release",
"defines": [],
"include_dirs": [],
"libraries": []
},
"variables": {
"asan": 0,
"coverage": "false",
"debug_devtools": "node",
"debug_http2": "false",
"debug_nghttp2": "false",
"force_dynamic_crt": 0,
"gas_version": "2.23",
"host_arch": "x64",
"icu_data_file": "icudt60l.dat",
"icu_data_in": "../../deps/icu-small/source/data/in/icudt60l.dat",
"icu_endianness": "l",
"icu_gyp_path": "tools/icu/icu-generic.gyp",
"icu_locales": "en,root",
"icu_path": "deps/icu-small",
"icu_small": "true",
"icu_ver_major": "60",
"llvm_version": 0,
"node_byteorder": "little",
"node_enable_d8": "false",
"node_enable_v8_vtunejit": "false",
"node_install_npm": "true",
"node_module_version": 57,
"node_no_browser_globals": "false",
"node_prefix": "/",
"node_release_urlbase": "https://nodejs.org/download/release/",
"node_shared": "false",
"node_shared_cares": "false",
"node_shared_http_parser": "false",
"node_shared_libuv": "false",
"node_shared_nghttp2": "false",
"node_shared_openssl": "false",
"node_shared_zlib": "false",
"node_tag": "",
"node_use_bundled_v8": "true",
"node_use_dtrace": "false",
"node_use_etw": "false",
"node_use_lttng": "false",
"node_use_openssl": "true",
"node_use_perfctr": "false",
"node_use_v8_platform": "true",
"node_without_node_options": "false",
"openssl_fips": "",
"openssl_no_asm": 0,
"shlib_suffix": "so.57",
"target_arch": "x64",
"uv_parent_path": "/deps/uv/",
"uv_use_dtrace": "false",
"v8_enable_gdbjit": 0,
"v8_enable_i18n_support": 1,
"v8_enable_inspector": 1,
"v8_no_strict_aliasing": 1,
"v8_optimized_debug": 0,
"v8_promise_internal_field_count": 1,
"v8_random_seed": 0,
"v8_trace_maps": 0,
"v8_use_snapshot": "true",
"want_separate_host_toolset": 0,
"nodedir": "/home/wn/.node-gyp/8.11.1",
"standalone_static_library": 1,
"cache_lock_stale": "60000",
"ham_it_up": "",
"legacy_bundling": "",
"sign_git_tag": "",
"user_agent": "npm/6.0.1 node/v8.11.1 linux x64",
"always_auth": "",
"bin_links": "true",
"key": "",
"allow_same_version": "",
"description": "true",
"fetch_retries": "2",
"heading": "npm",
"if_present": "",
"init_version": "1.0.0",
"user": "",
"prefer_online": "",
"force": "",
"only": "",
"read_only": "",
"cache_min": "10",
"init_license": "ISC",
"editor": "vi",
"rollback": "true",
"tag_version_prefix": "v",
"cache_max": "Infinity",
"timing": "",
"userconfig": "/home/wn/.npmrc",
"engine_strict": "",
"init_author_name": "",
"init_author_url": "",
"tmp": "/tmp",
"depth": "Infinity",
"package_lock_only": "",
"save_dev": "",
"usage": "",
"metrics_registry": "https://registry.npmjs.org/",
"otp": "",
"package_lock": "true",
"progress": "true",
"https_proxy": "",
"save_prod": "",
"audit": "true",
"cidr": "",
"onload_script": "",
"sso_type": "oauth",
"rebuild_bundle": "true",
"save_bundle": "",
"shell": "/bin/bash",
"dry_run": "",
"prefix": "/usr",
"scope": "",
"browser": "",
"cache_lock_wait": "10000",
"ignore_prepublish": "",
"registry": "https://registry.npmjs.org/",
"save_optional": "",
"searchopts": "",
"versions": "",
"cache": "/home/wn/.npm",
"send_metrics": "",
"global_style": "",
"ignore_scripts": "",
"version": "",
"local_address": "",
"viewer": "man",
"node_gyp": "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",
"prefer_offline": "",
"color": "true",
"no_proxy": "",
"fetch_retry_mintimeout": "10000",
"maxsockets": "50",
"offline": "",
"sso_poll_frequency": "500",
"umask": "0022",
"fetch_retry_maxtimeout": "60000",
"logs_max": "10",
"message": "%s",
"ca": "",
"cert": "",
"global": "",
"link": "",
"save": "true",
"access": "",
"also": "",
"unicode": "true",
"long": "",
"production": "",
"searchlimit": "20",
"unsafe_perm": "true",
"auth_type": "legacy",
"node_version": "8.11.1",
"tag": "latest",
"git_tag_version": "true",
"commit_hooks": "true",
"script_shell": "",
"shrinkwrap": "true",
"fetch_retry_factor": "10",
"save_exact": "",
"strict_ssl": "true",
"dev": "",
"globalconfig": "/usr/etc/npmrc",
"init_module": "/home/wn/.npm-init.js",
"parseable": "",
"globalignorefile": "/usr/etc/npmignore",
"cache_lock_retries": "10",
"searchstaleness": "900",
"node_options": "",
"save_prefix": "^",
"scripts_prepend_node_path": "warn-only",
"group": "1000",
"init_author_email": "",
"searchexclude": "",
"git": "git",
"optional": "true",
"json": ""
}
}

145
node_modules/epoll/build/epoll.target.mk generated vendored Normal file
View File

@ -0,0 +1,145 @@
# This file is generated by gyp; do not edit.
TOOLSET := target
TARGET := epoll
DEFS_Debug := \
'-DNODE_GYP_MODULE_NAME=epoll' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \
'-DBUILDING_NODE_EXTENSION' \
'-DDEBUG' \
'-D_DEBUG' \
'-DV8_ENABLE_CHECKS'
# Flags passed to all source files.
CFLAGS_Debug := \
-fPIC \
-pthread \
-Wall \
-Wextra \
-Wno-unused-parameter \
-m64 \
-Wno-unused-local-typedefs \
-g \
-O0
# Flags passed to only C files.
CFLAGS_C_Debug :=
# Flags passed to only C++ files.
CFLAGS_CC_Debug := \
-fno-rtti \
-fno-exceptions \
-std=gnu++0x
INCS_Debug := \
-I/home/wn/.node-gyp/8.11.1/include/node \
-I/home/wn/.node-gyp/8.11.1/src \
-I/home/wn/.node-gyp/8.11.1/deps/uv/include \
-I/home/wn/.node-gyp/8.11.1/deps/v8/include \
-I$(srcdir)/../nan
DEFS_Release := \
'-DNODE_GYP_MODULE_NAME=epoll' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \
'-DBUILDING_NODE_EXTENSION'
# Flags passed to all source files.
CFLAGS_Release := \
-fPIC \
-pthread \
-Wall \
-Wextra \
-Wno-unused-parameter \
-m64 \
-Wno-unused-local-typedefs \
-O3 \
-fno-omit-frame-pointer
# Flags passed to only C files.
CFLAGS_C_Release :=
# Flags passed to only C++ files.
CFLAGS_CC_Release := \
-fno-rtti \
-fno-exceptions \
-std=gnu++0x
INCS_Release := \
-I/home/wn/.node-gyp/8.11.1/include/node \
-I/home/wn/.node-gyp/8.11.1/src \
-I/home/wn/.node-gyp/8.11.1/deps/uv/include \
-I/home/wn/.node-gyp/8.11.1/deps/v8/include \
-I$(srcdir)/../nan
OBJS := \
$(obj).target/$(TARGET)/src/epoll.o
# Add to the list of files we specially track dependencies for.
all_deps += $(OBJS)
# CFLAGS et al overrides must be target-local.
# See "Target-specific Variable Values" in the GNU Make manual.
$(OBJS): TOOLSET := $(TOOLSET)
$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
# Suffix rules, putting all outputs into $(obj).
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
# Try building from generated source, too.
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
# End of this set of suffix rules
### Rules for final target.
LDFLAGS_Debug := \
-pthread \
-rdynamic \
-m64
LDFLAGS_Release := \
-pthread \
-rdynamic \
-m64
LIBS :=
$(obj).target/epoll.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
$(obj).target/epoll.node: LIBS := $(LIBS)
$(obj).target/epoll.node: TOOLSET := $(TOOLSET)
$(obj).target/epoll.node: $(OBJS) FORCE_DO_CMD
$(call do_cmd,solink_module)
all_deps += $(obj).target/epoll.node
# Add target alias
.PHONY: epoll
epoll: $(builddir)/epoll.node
# Copy this to the executable output path.
$(builddir)/epoll.node: TOOLSET := $(TOOLSET)
$(builddir)/epoll.node: $(obj).target/epoll.node FORCE_DO_CMD
$(call do_cmd,copy)
all_deps += $(builddir)/epoll.node
# Short alias for building this executable.
.PHONY: epoll.node
epoll.node: $(obj).target/epoll.node $(builddir)/epoll.node
# Add executable to "all" target.
.PHONY: all
all: $(builddir)/epoll.node

Some files were not shown because too many files have changed in this diff Show More