From 6218d8d585838be89d7ad67d4e13b5fb42015c08 Mon Sep 17 00:00:00 2001 From: mmcw-dev Date: Thu, 19 Oct 2017 21:52:13 -0400 Subject: [PATCH] Refactor intval library to use object. The nature of the GPIO module in use breaks references to this --- lib/intval/Readme.md | 74 +-- lib/intval/index.js | 478 +++++++++--------- package-lock.json | 1110 +----------------------------------------- tests/index.js | 4 +- 4 files changed, 280 insertions(+), 1386 deletions(-) diff --git a/lib/intval/Readme.md b/lib/intval/Readme.md index 967573a..fd7df24 100644 --- a/lib/intval/Readme.md +++ b/lib/intval/Readme.md @@ -1,54 +1,54 @@ - + -## Intval -Class representing the intval3 features +## intval +Object representing the intval3 features -**Kind**: global class +**Kind**: global constant -* [Intval](#Intval) - * [._declarePins()](#Intval+_declarePins) - * [._undeclarePins()](#Intval+_undeclarePins) - * [._startFwd()](#Intval+_startFwd) - * [._startBwd()](#Intval+_startBwd) - * [._stop()](#Intval+_stop) - * [._watchMicro(err, val)](#Intval+_watchMicro) - * [._watchRelease(err, val)](#Intval+_watchRelease) - * [.setDir([dir])](#Intval+setDir) - * [.frame([dir], [time])](#Intval+frame) - * [.sequence()](#Intval+sequence) +* [intval](#intval) + * [._declarePins()](#intval._declarePins) + * [._undeclarePins()](#intval._undeclarePins) + * [._startFwd()](#intval._startFwd) + * [._startBwd()](#intval._startBwd) + * [._stop()](#intval._stop) + * [._watchMicro(err, val)](#intval._watchMicro) + * [._watchRelease(err, val)](#intval._watchRelease) + * [.setDir([dir])](#intval.setDir) + * [.frame([dir], [time])](#intval.frame) + * [.sequence()](#intval.sequence) - + ### intval._declarePins() (internal function) Declares all Gpio pins that will be used -**Kind**: instance method of [Intval](#Intval) - +**Kind**: static method of [intval](#intval) + ### intval._undeclarePins() (internal function) Undeclares all Gpio in event of uncaught error that interupts the node process -**Kind**: instance method of [Intval](#Intval) - +**Kind**: static method of [intval](#intval) + ### intval._startFwd() Start motor in forward direction by setting correct pins in h-bridge -**Kind**: instance method of [Intval](#Intval) - +**Kind**: static method of [intval](#intval) + ### intval._startBwd() Start motor in backward direction by setting correct pins in h-bridge -**Kind**: instance method of [Intval](#Intval) - +**Kind**: static method of [intval](#intval) + ### intval._stop() Stop motor by setting both motor pins to 0 (LOW) -**Kind**: instance method of [Intval](#Intval) - +**Kind**: static method of [intval](#intval) + ### intval._watchMicro(err, val) Callback for watching relese switch state changes. @@ -61,14 +61,14 @@ Microswitch + 10K ohm resistor * 1 === open * 0 === closed -**Kind**: instance method of [Intval](#Intval) +**Kind**: static method of [intval](#intval) | Param | Type | Description | | --- | --- | --- | | err | object | Error object present if problem reading pin | | val | integer | Current value of the pin | - + ### intval._watchRelease(err, val) Callback for watching relese switch state changes. @@ -76,48 +76,48 @@ Using GPIO 05 on Raspberry Pi Zero W. 1) If closed, start timer. 2) If opened, check timer AND -3) If `press` (`NOW - this._state.release.time`) greater than minimum and less than `this._releaseSequence`, start frame -4) If `press` greater than `this._releaseSequence`, start sequence +3) If `press` (`now - intval._state.release.time`) greater than minimum and less than `intval._releaseSequence`, start frame +4) If `press` greater than `intval._releaseSequence`, start sequence Button + 10K ohm resistor * 1 === open * 0 === closed -**Kind**: instance method of [Intval](#Intval) +**Kind**: static method of [intval](#intval) | Param | Type | Description | | --- | --- | --- | | err | object | Error object present if problem reading pin | | val | integer | Current value of the pin | - + ### intval.setDir([dir]) Set the default direction of the camera. * forward = true * backward = false -**Kind**: instance method of [Intval](#Intval) +**Kind**: static method of [intval](#intval) | Param | Type | Default | Description | | --- | --- | --- | --- | | [dir] | boolean | true | Direction of the camera | - + ### intval.frame([dir], [time]) Begin a single frame with set variables or defaults -**Kind**: instance method of [Intval](#Intval) +**Kind**: static method of [intval](#intval) | Param | Type | Default | Description | | --- | --- | --- | --- | | [dir] | boolean | "null" | (optional) Direction of the frame | | [time] | integer | "null" | (optional) Exposure time, 0 = minimum | - + ### intval.sequence() Start a sequence of frames, using defaults or explicit instructions -**Kind**: instance method of [Intval](#Intval) +**Kind**: static method of [intval](#intval) diff --git a/lib/intval/index.js b/lib/intval/index.js index 78d5b0b..2a8aab2 100644 --- a/lib/intval/index.js +++ b/lib/intval/index.js @@ -32,256 +32,256 @@ const PINS = { } } -/** Class representing the intval3 features */ -class Intval { - constructor () { - this._pin = {} - this._state = { - dir : true, //forward - frame : { - start : 0, //time frame started, timestamp - active : false, //should frame be running - time : 0, //length of frame, in ms - delay : 0, //delay before start of frame, in ms +/** Object representing the intval3 features */ +const intval = {} - expected : 1000 //expected length of frame, in ms - }, - release : { - time: 0, - active : false //is pressed - }, - micro : { - time : 0, - primed : false //is ready to stop frame - } - } - - this._releaseMin = 50 - this._releaseSequence = 1000 - this._microDelay = 10 // delay after stop signal before stopping motors +intval.init = function () { + intval._pin = {} + intval._state = { + dir : true, //forward + frame : { + start : 0, //time frame started, timestamp + active : false, //should frame be running + time : 0, //length of frame, in ms + delay : 0, //delay before start of frame, in ms - this._declarePins() - process.on('SIGINT', this._undeclarePins) - process.on('uncaughtException', this._undeclarePins) - } - /** - * (internal function) Declares all Gpio pins that will be used - * - */ - _declarePins () { - let pin - for (let p in PINS) { - pin = PINS[p] - if (pin.edge) this._pin[p] = Gpio(pin.pin, pin.dir, pin.edge) - if (!pin.edge) this._pin[p] = Gpio(pin.pin, pin.dir) - log.info('_declarePins', { pin : pin.pin, dir : pin.dir, edge : pin.edge }) + expected : 1000 //expected length of frame, in ms + }, + release : { + time: 0, + active : false //is pressed + }, + micro : { + time : 0, + primed : false //is ready to stop frame } - this._pin.release.watch(this._watchRelease) } - /** - * (internal function) Undeclares all Gpio in event of uncaught error - * that interupts the node process - * - */ - _undeclarePins (e) { - log.error(e) - if (!this._pin) { - log.warn('_undeclarePins', { reason : 'No pins'}) - return process.exit() - } - log.warn('_undeclarePins', { pin : PINS.fwd.pin, val : 0, reason : 'exiting'}) - this._pin.fwd.writeSync(0) - log.warn('_undeclarePins', { pin : PINS.bwd.pin, val : 0, reason : 'exiting'}) - this._pin.bwd.writeSync(0) - this._pin.fwd.unexport() - this._pin.bwd.unexport() - this._pin.micro.unexport() - this._pin.release.unexport() - process.exit() - } - /** - * Start motor in forward direction by setting correct pins in h-bridge - * - */ - _startFwd () { - this._pin.fwd.writeSync(1) - this._pin.bwd.writeSync(0) - //start high-cpu watch - } - /** - * Start motor in backward direction by setting correct pins in h-bridge - * - */ - _startBwd () { - this._pin.fwd.writeSync(0) - this._pin.bwd.writeSync(1) - } - /** - * Stop motor by setting both motor pins to 0 (LOW) - * - */ - _stop () { - this._pin.fwd.writeSync(0) - this._pin.bwd.writeSync(0) + + intval._releaseMin = 50 + intval._releaseSequence = 1000 + intval._microDelay = 10 // delay after stop signal before stopping motors - let len = (+new Date()) - this._state.frame.start - - log.info(`Frame stopped ${len}ms`) - - this._pin.micro.unwatch() - this._state.frame.active = false - this._state.frame.start = 0 + intval._declarePins() + process.on('SIGINT', intval._undeclarePins) + process.on('uncaughtException', intval._undeclarePins) +} +/** +* (internal function) Declares all Gpio pins that will be used +* +*/ +intval._declarePins = function () { + let pin + for (let p in PINS) { + pin = PINS[p] + if (pin.edge) intval._pin[p] = Gpio(pin.pin, pin.dir, pin.edge) + if (!pin.edge) intval._pin[p] = Gpio(pin.pin, pin.dir) + log.info('_declarePins', { pin : pin.pin, dir : pin.dir, edge : pin.edge }) } - /** - * Callback for watching relese switch state changes. - * Using GPIO 06 on Raspberry Pi Zero W. - * - * 1) If closed AND frame active, start timer, set state primed to `true`. - * 1) If opened AND frame active, stop frame - * - * Microswitch + 10K ohm resistor - * * 1 === open - * * 0 === closed - * - * - * @param {object} err Error object present if problem reading pin - * @param {integer} val Current value of the pin - * - */ - _watchMicro (err, val) { - const NOW = +new Date() - if (err) { - log.error('_watchMicro', err) - } - //determine when to stop - if (val === 0 && this._state.frame.active) { - if (!this._state.micro.primed) { - this._state.micro.primed = true - this._state.micro.time = NOW - log.info('Mircoswitch primed to stop motor') - } - } else if (val === 1 && this._state.frame.active) { - if (this._state.micro.primed) { - this._state.micro.primed = false - this._state.micro.time = 0 - setTimeout( () => { - log.info(`Stopped frame after ${NOW - this._state.micro.time}ms`) - }, this._microDelay) - } - } - } - /** - * Callback for watching relese switch state changes. - * Using GPIO 05 on Raspberry Pi Zero W. - * - * 1) If closed, start timer. - * 2) If opened, check timer AND - * 3) If `press` (`now - this._state.release.time`) greater than minimum and less than `this._releaseSequence`, start frame - * 4) If `press` greater than `this._releaseSequence`, start sequence - * - * Button + 10K ohm resistor - * * 1 === open - * * 0 === closed - * - * @param {object} err Error object present if problem reading pin - * @param {integer} val Current value of the pin - * - */ - _watchRelease (err, val) { - const now = +new Date() - let press = 0 - if (err) { - return log.error(err) - } - log.info(`Release switch val: ${val}`) - if (val === 0) { - //closed - if (this._releaseClosedState(now)) { - this._state.release.time = now - this._state.release.active = true //maybe unncecessary - } - } else if (val === 1) { - //opened - if (this._state.release.active) { - press = now - this._state.release.time - if (press > this._releaseMin && press < this._releaseSequence) { - this.frame() - } else if (press >= this._releaseSequence) { - this.sequence() - } - log.info(`Release closed for ${press}ms`) - this._state.release.time = 0 - this._state.release.active = false - } - } - log.info('completed if statement') + intval._pin.release.watch(intval._watchRelease) +} +/** +* (internal function) Undeclares all Gpio in event of uncaught error +* that interupts the node process +* +*/ +intval._undeclarePins = function (e) { + log.error(e) + if (!intval._pin) { + log.warn('_undeclarePins', { reason : 'No pins'}) + return process.exit() } + log.warn('_undeclarePins', { pin : PINS.fwd.pin, val : 0, reason : 'exiting'}) + intval._pin.fwd.writeSync(0) + log.warn('_undeclarePins', { pin : PINS.bwd.pin, val : 0, reason : 'exiting'}) + intval._pin.bwd.writeSync(0) + intval._pin.fwd.unexport() + intval._pin.bwd.unexport() + intval._pin.micro.unexport() + intval._pin.release.unexport() + process.exit() +} +/** +* Start motor in forward direction by setting correct pins in h-bridge +* +*/ +intval._startFwd = function () { + intval._pin.fwd.writeSync(1) + intval._pin.bwd.writeSync(0) + //start high-cpu watch +} +/** +* Start motor in backward direction by setting correct pins in h-bridge +* +*/ +intval._startBwd = function () { + intval._pin.fwd.writeSync(0) + intval._pin.bwd.writeSync(1) +} +/** +* Stop motor by setting both motor pins to 0 (LOW) +* +*/ +intval._stop = function () { + intval._pin.fwd.writeSync(0) + intval._pin.bwd.writeSync(0) - _releaseClosedState (now) { - if (!this._state.release.active && this._state.release.time === 0) { - return true - } - if (this._state.release.active && (now - this._state.release.time) > (this._releaseSequence * 10)) { - return true - } - return false - } - /** - * Set the default direction of the camera. - * * forward = true - * * backward = false - * - * @param {boolean} [dir=true] Direction of the camera - * - */ - setDir (val = true) { - if (typeof val !== 'boolean') { - return log.warn('Direction must be represented as either true or false') - } - this._state.dir = val - } - /** - * Begin a single frame with set variables or defaults - * - * @param {?boolean} [dir="null"] (optional) Direction of the frame - * @param {?integer} [time="null"] (optional) Exposure time, 0 = minimum - * - */ - frame (dir = null, time = null) { - if (dir === true || (dir === null && this._state.dir === true) ) { - dir = true - } else { - dir = false - } - - if (time === null && this._state.time !== 0) { - time = this._state.time - } else { - time = 0 - } + let len = (+new Date()) - intval._state.frame.start - this._state.frame.start = +new Date() - this._state.frame.active = true - this._pin.micro.watch(this._watchMicro) + log.info(`Frame stopped ${len}ms`) - log.info('frame', {dir : dir, time : time}) - - if (dir) { - this._startFwd() - } else { - this._startBwd() + intval._pin.micro.unwatch() + intval._state.frame.active = false + intval._state.frame.start = 0 +} +/** +* Callback for watching relese switch state changes. +* Using GPIO 06 on Raspberry Pi Zero W. +* +* 1) If closed AND frame active, start timer, set state primed to `true`. +* 1) If opened AND frame active, stop frame +* +* Microswitch + 10K ohm resistor +* * 1 === open +* * 0 === closed +* +* +* @param {object} err Error object present if problem reading pin +* @param {integer} val Current value of the pin +* +*/ +intval._watchMicro = function (err, val) { + const NOW = +new Date() + if (err) { + log.error('_watchMicro', err) + } + //determine when to stop + if (val === 0 && intval._state.frame.active) { + if (!intval._state.micro.primed) { + intval._state.micro.primed = true + intval._state.micro.time = NOW + log.info('Mircoswitch primed to stop motor') + } + } else if (val === 1 && intval._state.frame.active) { + if (intval._state.micro.primed) { + intval._state.micro.primed = false + intval._state.micro.time = 0 + setTimeout( () => { + log.info(`Stopped frame after ${NOW - intval._state.micro.time}ms`) + }, intval._microDelay) } - } - /** - * Start a sequence of frames, using defaults or explicit instructions - * - */ - sequence () { - log.info('sequence', `Started sequence`) - } - status () { - return this._state } } +/** +* Callback for watching relese switch state changes. +* Using GPIO 05 on Raspberry Pi Zero W. +* +* 1) If closed, start timer. +* 2) If opened, check timer AND +* 3) If `press` (`now - intval._state.release.time`) greater than minimum and less than `intval._releaseSequence`, start frame +* 4) If `press` greater than `intval._releaseSequence`, start sequence +* +* Button + 10K ohm resistor +* * 1 === open +* * 0 === closed +* +* @param {object} err Error object present if problem reading pin +* @param {integer} val Current value of the pin +* +*/ +intval._watchRelease = function (err, val) { + const now = +new Date() + let press = 0 + if (err) { + return log.error(err) + } + log.info(`Release switch val: ${val}`) + if (val === 0) { + //closed + if (intval._releaseClosedState(now)) { + intval._state.release.time = now + intval._state.release.active = true //maybe unncecessary + } + } else if (val === 1) { + //opened + if (intval._state.release.active) { + press = now - intval._state.release.time + if (press > intval._releaseMin && press < intval._releaseSequence) { + intval.frame() + } else if (press >= intval._releaseSequence) { + intval.sequence() + } + log.info(`Release closed for ${press}ms`) + intval._state.release.time = 0 + intval._state.release.active = false + } + } + log.info('completed if statement') +} -module.exports = new Intval() \ No newline at end of file +intval._releaseClosedState = function (now) { + if (!intval._state.release.active && intval._state.release.time === 0) { + return true + } + if (intval._state.release.active && (now - intval._state.release.time) > (intval._releaseSequence * 10)) { + return true + } + return false +} +/** +* Set the default direction of the camera. +* * forward = true +* * backward = false +* +* @param {boolean} [dir=true] Direction of the camera +* +*/ +intval.setDir = function (val = true) { + if (typeof val !== 'boolean') { + return log.warn('Direction must be represented as either true or false') + } + intval._state.dir = val +} +/** +* Begin a single frame with set variables or defaults +* +* @param {?boolean} [dir="null"] (optional) Direction of the frame +* @param {?integer} [time="null"] (optional) Exposure time, 0 = minimum +* +*/ +intval.frame = function (dir = null, time = null) { + if (dir === true || (dir === null && intval._state.dir === true) ) { + dir = true + } else { + dir = false + } + + if (time === null && intval._state.time !== 0) { + time = intval._state.time + } else { + time = 0 + } + + intval._state.frame.start = +new Date() + intval._state.frame.active = true + intval._pin.micro.watch(intval._watchMicro) + + log.info('frame', {dir : dir, time : time}) + + if (dir) { + intval._startFwd() + } else { + intval._startBwd() + } +} +/** +* Start a sequence of frames, using defaults or explicit instructions +* +*/ +intval.sequence = function () { + log.info('sequence', `Started sequence`) +} +intval.status = function () { + return intval._state +} + +module.exports = intval \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index bf33259..e8de43b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -112,8 +112,7 @@ "optional": true, "requires": { "debug": "2.6.8", - "nan": "2.6.2", - "usb": "1.2.0" + "nan": "2.6.2" } }, "bplist-parser": { @@ -1361,1113 +1360,6 @@ } } }, - "usb": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/usb/-/usb-1.2.0.tgz", - "integrity": "sha1-q3LZeGoEcGiRmgJNCMehxbHmD0c=", - "optional": true, - "requires": { - "nan": "2.6.2", - "node-pre-gyp": "0.6.30" - }, - "dependencies": { - "node-pre-gyp": { - "version": "0.6.30", - "bundled": true, - "optional": true, - "requires": { - "mkdirp": "0.5.1", - "nopt": "3.0.6", - "npmlog": "4.0.0", - "rc": "1.1.6", - "request": "2.74.0", - "rimraf": "2.5.4", - "semver": "5.3.0", - "tar": "2.2.1", - "tar-pack": "3.1.4" - }, - "dependencies": { - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "bundled": true - } - } - }, - "nopt": { - "version": "3.0.6", - "bundled": true, - "optional": true, - "requires": { - "abbrev": "1.0.9" - }, - "dependencies": { - "abbrev": { - "version": "1.0.9", - "bundled": true, - "optional": true - } - } - }, - "npmlog": { - "version": "4.0.0", - "bundled": true, - "optional": true, - "requires": { - "are-we-there-yet": "1.1.2", - "console-control-strings": "1.1.0", - "gauge": "2.6.0", - "set-blocking": "2.0.0" - }, - "dependencies": { - "are-we-there-yet": { - "version": "1.1.2", - "bundled": true, - "optional": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.1.5" - }, - "dependencies": { - "delegates": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "readable-stream": { - "version": "2.1.5", - "bundled": true, - "optional": true, - "requires": { - "buffer-shims": "1.0.0", - "core-util-is": "1.0.2", - "inherits": "2.0.1", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" - }, - "dependencies": { - "buffer-shims": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "inherits": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "process-nextick-args": { - "version": "1.0.7", - "bundled": true, - "optional": true - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "optional": true - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "optional": true - } - } - } - } - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true - }, - "gauge": { - "version": "2.6.0", - "bundled": true, - "optional": true, - "requires": { - "aproba": "1.0.4", - "console-control-strings": "1.1.0", - "has-color": "0.1.7", - "has-unicode": "2.0.1", - "object-assign": "4.1.0", - "signal-exit": "3.0.0", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.0" - }, - "dependencies": { - "aproba": { - "version": "1.0.4", - "bundled": true, - "optional": true - }, - "has-color": { - "version": "0.1.7", - "bundled": true, - "optional": true - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "object-assign": { - "version": "4.1.0", - "bundled": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.0", - "bundled": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "requires": { - "code-point-at": "1.0.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - }, - "dependencies": { - "code-point-at": { - "version": "1.0.0", - "bundled": true, - "requires": { - "number-is-nan": "1.0.0" - }, - "dependencies": { - "number-is-nan": { - "version": "1.0.0", - "bundled": true - } - } - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "requires": { - "number-is-nan": "1.0.0" - }, - "dependencies": { - "number-is-nan": { - "version": "1.0.0", - "bundled": true - } - } - } - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "requires": { - "ansi-regex": "2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.0.0", - "bundled": true - } - } - }, - "wide-align": { - "version": "1.1.0", - "bundled": true, - "optional": true, - "requires": { - "string-width": "1.0.2" - } - } - } - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "optional": true - } - } - }, - "rc": { - "version": "1.1.6", - "bundled": true, - "optional": true, - "requires": { - "deep-extend": "0.4.1", - "ini": "1.3.4", - "minimist": "1.2.0", - "strip-json-comments": "1.0.4" - }, - "dependencies": { - "deep-extend": { - "version": "0.4.1", - "bundled": true, - "optional": true - }, - "ini": { - "version": "1.3.4", - "bundled": true, - "optional": true - }, - "minimist": { - "version": "1.2.0", - "bundled": true, - "optional": true - }, - "strip-json-comments": { - "version": "1.0.4", - "bundled": true, - "optional": true - } - } - }, - "request": { - "version": "2.74.0", - "bundled": true, - "optional": true, - "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.4.1", - "bl": "1.1.2", - "caseless": "0.11.0", - "combined-stream": "1.0.5", - "extend": "3.0.0", - "forever-agent": "0.6.1", - "form-data": "1.0.1", - "har-validator": "2.0.6", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.11", - "node-uuid": "1.4.7", - "oauth-sign": "0.8.2", - "qs": "6.2.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.1", - "tunnel-agent": "0.4.3" - }, - "dependencies": { - "aws-sign2": { - "version": "0.6.0", - "bundled": true, - "optional": true - }, - "aws4": { - "version": "1.4.1", - "bundled": true, - "optional": true - }, - "bl": { - "version": "1.1.2", - "bundled": true, - "optional": true, - "requires": { - "readable-stream": "2.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "2.0.6", - "bundled": true, - "optional": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.1", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" - }, - "dependencies": { - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "inherits": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "process-nextick-args": { - "version": "1.0.7", - "bundled": true, - "optional": true - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "optional": true - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "optional": true - } - } - } - } - }, - "caseless": { - "version": "0.11.0", - "bundled": true, - "optional": true - }, - "combined-stream": { - "version": "1.0.5", - "bundled": true, - "requires": { - "delayed-stream": "1.0.0" - }, - "dependencies": { - "delayed-stream": { - "version": "1.0.0", - "bundled": true - } - } - }, - "extend": { - "version": "3.0.0", - "bundled": true, - "optional": true - }, - "forever-agent": { - "version": "0.6.1", - "bundled": true, - "optional": true - }, - "form-data": { - "version": "1.0.1", - "bundled": true, - "optional": true, - "requires": { - "async": "2.0.1", - "combined-stream": "1.0.5", - "mime-types": "2.1.11" - }, - "dependencies": { - "async": { - "version": "2.0.1", - "bundled": true, - "optional": true, - "requires": { - "lodash": "4.15.0" - }, - "dependencies": { - "lodash": { - "version": "4.15.0", - "bundled": true, - "optional": true - } - } - } - } - }, - "har-validator": { - "version": "2.0.6", - "bundled": true, - "optional": true, - "requires": { - "chalk": "1.1.3", - "commander": "2.9.0", - "is-my-json-valid": "2.13.1", - "pinkie-promise": "2.0.1" - }, - "dependencies": { - "chalk": { - "version": "1.1.3", - "bundled": true, - "optional": true, - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "bundled": true, - "optional": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "bundled": true, - "optional": true - }, - "has-ansi": { - "version": "2.0.0", - "bundled": true, - "optional": true, - "requires": { - "ansi-regex": "2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.0.0", - "bundled": true, - "optional": true - } - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "optional": true, - "requires": { - "ansi-regex": "2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.0.0", - "bundled": true, - "optional": true - } - } - }, - "supports-color": { - "version": "2.0.0", - "bundled": true, - "optional": true - } - } - }, - "commander": { - "version": "2.9.0", - "bundled": true, - "optional": true, - "requires": { - "graceful-readlink": "1.0.1" - }, - "dependencies": { - "graceful-readlink": { - "version": "1.0.1", - "bundled": true, - "optional": true - } - } - }, - "is-my-json-valid": { - "version": "2.13.1", - "bundled": true, - "optional": true, - "requires": { - "generate-function": "2.0.0", - "generate-object-property": "1.2.0", - "jsonpointer": "2.0.0", - "xtend": "4.0.1" - }, - "dependencies": { - "generate-function": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "generate-object-property": { - "version": "1.2.0", - "bundled": true, - "optional": true, - "requires": { - "is-property": "1.0.2" - }, - "dependencies": { - "is-property": { - "version": "1.0.2", - "bundled": true, - "optional": true - } - } - }, - "jsonpointer": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "xtend": { - "version": "4.0.1", - "bundled": true, - "optional": true - } - } - }, - "pinkie-promise": { - "version": "2.0.1", - "bundled": true, - "optional": true, - "requires": { - "pinkie": "2.0.4" - }, - "dependencies": { - "pinkie": { - "version": "2.0.4", - "bundled": true, - "optional": true - } - } - } - } - }, - "hawk": { - "version": "3.1.3", - "bundled": true, - "optional": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - }, - "dependencies": { - "boom": { - "version": "2.10.1", - "bundled": true, - "requires": { - "hoek": "2.16.3" - } - }, - "cryptiles": { - "version": "2.0.5", - "bundled": true, - "optional": true, - "requires": { - "boom": "2.10.1" - } - }, - "hoek": { - "version": "2.16.3", - "bundled": true - }, - "sntp": { - "version": "1.0.9", - "bundled": true, - "optional": true, - "requires": { - "hoek": "2.16.3" - } - } - } - }, - "http-signature": { - "version": "1.1.1", - "bundled": true, - "optional": true, - "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.3.0", - "sshpk": "1.10.0" - }, - "dependencies": { - "assert-plus": { - "version": "0.2.0", - "bundled": true, - "optional": true - }, - "jsprim": { - "version": "1.3.0", - "bundled": true, - "optional": true, - "requires": { - "extsprintf": "1.0.2", - "json-schema": "0.2.2", - "verror": "1.3.6" - }, - "dependencies": { - "extsprintf": { - "version": "1.0.2", - "bundled": true - }, - "json-schema": { - "version": "0.2.2", - "bundled": true, - "optional": true - }, - "verror": { - "version": "1.3.6", - "bundled": true, - "optional": true, - "requires": { - "extsprintf": "1.0.2" - } - } - } - }, - "sshpk": { - "version": "1.10.0", - "bundled": true, - "optional": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.0", - "dashdash": "1.14.0", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.6", - "jodid25519": "1.0.2", - "jsbn": "0.1.0", - "tweetnacl": "0.13.3" - }, - "dependencies": { - "asn1": { - "version": "0.2.3", - "bundled": true, - "optional": true - }, - "assert-plus": { - "version": "1.0.0", - "bundled": true - }, - "bcrypt-pbkdf": { - "version": "1.0.0", - "bundled": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.3" - }, - "dependencies": { - "tweetnacl": { - "version": "0.14.3", - "bundled": true, - "optional": true - } - } - }, - "dashdash": { - "version": "1.14.0", - "bundled": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - } - }, - "ecc-jsbn": { - "version": "0.1.1", - "bundled": true, - "optional": true, - "requires": { - "jsbn": "0.1.0" - } - }, - "getpass": { - "version": "0.1.6", - "bundled": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - } - }, - "jodid25519": { - "version": "1.0.2", - "bundled": true, - "optional": true, - "requires": { - "jsbn": "0.1.0" - } - }, - "jsbn": { - "version": "0.1.0", - "bundled": true, - "optional": true - }, - "tweetnacl": { - "version": "0.13.3", - "bundled": true, - "optional": true - } - } - } - } - }, - "is-typedarray": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "isstream": { - "version": "0.1.2", - "bundled": true, - "optional": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "bundled": true, - "optional": true - }, - "mime-types": { - "version": "2.1.11", - "bundled": true, - "requires": { - "mime-db": "1.23.0" - }, - "dependencies": { - "mime-db": { - "version": "1.23.0", - "bundled": true - } - } - }, - "node-uuid": { - "version": "1.4.7", - "bundled": true, - "optional": true - }, - "oauth-sign": { - "version": "0.8.2", - "bundled": true, - "optional": true - }, - "qs": { - "version": "6.2.1", - "bundled": true, - "optional": true - }, - "stringstream": { - "version": "0.0.5", - "bundled": true, - "optional": true - }, - "tough-cookie": { - "version": "2.3.1", - "bundled": true, - "optional": true - }, - "tunnel-agent": { - "version": "0.4.3", - "bundled": true, - "optional": true - } - } - }, - "rimraf": { - "version": "2.5.4", - "bundled": true, - "requires": { - "glob": "7.0.6" - }, - "dependencies": { - "glob": { - "version": "7.0.6", - "bundled": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.5", - "inherits": "2.0.1", - "minimatch": "3.0.3", - "once": "1.3.3", - "path-is-absolute": "1.0.0" - }, - "dependencies": { - "fs.realpath": { - "version": "1.0.0", - "bundled": true - }, - "inflight": { - "version": "1.0.5", - "bundled": true, - "requires": { - "once": "1.3.3", - "wrappy": "1.0.2" - }, - "dependencies": { - "wrappy": { - "version": "1.0.2", - "bundled": true - } - } - }, - "inherits": { - "version": "2.0.1", - "bundled": true - }, - "minimatch": { - "version": "3.0.3", - "bundled": true, - "requires": { - "brace-expansion": "1.1.6" - }, - "dependencies": { - "brace-expansion": { - "version": "1.1.6", - "bundled": true, - "requires": { - "balanced-match": "0.4.2", - "concat-map": "0.0.1" - }, - "dependencies": { - "balanced-match": { - "version": "0.4.2", - "bundled": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true - } - } - } - } - }, - "once": { - "version": "1.3.3", - "bundled": true, - "requires": { - "wrappy": "1.0.2" - }, - "dependencies": { - "wrappy": { - "version": "1.0.2", - "bundled": true - } - } - }, - "path-is-absolute": { - "version": "1.0.0", - "bundled": true - } - } - } - } - }, - "semver": { - "version": "5.3.0", - "bundled": true, - "optional": true - }, - "tar": { - "version": "2.2.1", - "bundled": true, - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.10", - "inherits": "2.0.1" - }, - "dependencies": { - "block-stream": { - "version": "0.0.9", - "bundled": true, - "requires": { - "inherits": "2.0.1" - } - }, - "fstream": { - "version": "1.0.10", - "bundled": true, - "requires": { - "graceful-fs": "4.1.6", - "inherits": "2.0.1", - "mkdirp": "0.5.1", - "rimraf": "2.5.4" - }, - "dependencies": { - "graceful-fs": { - "version": "4.1.6", - "bundled": true - } - } - }, - "inherits": { - "version": "2.0.1", - "bundled": true - } - } - }, - "tar-pack": { - "version": "3.1.4", - "bundled": true, - "optional": true, - "requires": { - "debug": "2.2.0", - "fstream": "1.0.10", - "fstream-ignore": "1.0.5", - "once": "1.3.3", - "readable-stream": "2.1.5", - "rimraf": "2.5.4", - "tar": "2.2.1", - "uid-number": "0.0.6" - }, - "dependencies": { - "debug": { - "version": "2.2.0", - "bundled": true, - "optional": true, - "requires": { - "ms": "0.7.1" - }, - "dependencies": { - "ms": { - "version": "0.7.1", - "bundled": true, - "optional": true - } - } - }, - "fstream": { - "version": "1.0.10", - "bundled": true, - "requires": { - "graceful-fs": "4.1.6", - "inherits": "2.0.1", - "mkdirp": "0.5.1", - "rimraf": "2.5.4" - }, - "dependencies": { - "graceful-fs": { - "version": "4.1.6", - "bundled": true - }, - "inherits": { - "version": "2.0.1", - "bundled": true - } - } - }, - "fstream-ignore": { - "version": "1.0.5", - "bundled": true, - "optional": true, - "requires": { - "fstream": "1.0.10", - "inherits": "2.0.1", - "minimatch": "3.0.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "minimatch": { - "version": "3.0.3", - "bundled": true, - "optional": true, - "requires": { - "brace-expansion": "1.1.6" - }, - "dependencies": { - "brace-expansion": { - "version": "1.1.6", - "bundled": true, - "optional": true, - "requires": { - "balanced-match": "0.4.2", - "concat-map": "0.0.1" - }, - "dependencies": { - "balanced-match": { - "version": "0.4.2", - "bundled": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "optional": true - } - } - } - } - } - } - }, - "once": { - "version": "1.3.3", - "bundled": true, - "optional": true, - "requires": { - "wrappy": "1.0.2" - }, - "dependencies": { - "wrappy": { - "version": "1.0.2", - "bundled": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.1.5", - "bundled": true, - "optional": true, - "requires": { - "buffer-shims": "1.0.0", - "core-util-is": "1.0.2", - "inherits": "2.0.1", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" - }, - "dependencies": { - "buffer-shims": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "inherits": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "process-nextick-args": { - "version": "1.0.7", - "bundled": true, - "optional": true - }, - "string_decoder": { - "version": "0.10.31", - "bundled": true, - "optional": true - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "optional": true - } - } - }, - "uid-number": { - "version": "0.0.6", - "bundled": true, - "optional": true - } - } - } - } - } - } - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/tests/index.js b/tests/index.js index e09e086..657e5f7 100644 --- a/tests/index.js +++ b/tests/index.js @@ -1,3 +1,5 @@ 'use strict' -const intval = require('../lib/intval') \ No newline at end of file +const intval = require('../lib/intval') + +intval.init() \ No newline at end of file