aboutsummaryrefslogtreecommitdiff
path: root/node_modules/pretty-hrtime
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-10-10 03:43:44 +0200
committerFlorian Dold <florian.dold@gmail.com>2016-10-10 03:43:44 +0200
commitabd94a7f5a50f43c797a11b53549ae48fff667c3 (patch)
treeab8ed457f65cdd72e13e0571d2975729428f1551 /node_modules/pretty-hrtime
parenta0247c6a3fd6a09a41a7e35a3441324c4dcb58be (diff)
downloadwallet-core-abd94a7f5a50f43c797a11b53549ae48fff667c3.tar.xz
add node_modules to address #4364
Diffstat (limited to 'node_modules/pretty-hrtime')
-rw-r--r--node_modules/pretty-hrtime/.jshintignore1
-rw-r--r--node_modules/pretty-hrtime/.npmignore10
-rw-r--r--node_modules/pretty-hrtime/LICENSE20
-rw-r--r--node_modules/pretty-hrtime/README.md57
-rw-r--r--node_modules/pretty-hrtime/index.js80
-rw-r--r--node_modules/pretty-hrtime/package.json95
6 files changed, 263 insertions, 0 deletions
diff --git a/node_modules/pretty-hrtime/.jshintignore b/node_modules/pretty-hrtime/.jshintignore
new file mode 100644
index 000000000..cb28eb3c8
--- /dev/null
+++ b/node_modules/pretty-hrtime/.jshintignore
@@ -0,0 +1 @@
+node_modules/**
diff --git a/node_modules/pretty-hrtime/.npmignore b/node_modules/pretty-hrtime/.npmignore
new file mode 100644
index 000000000..094a5f358
--- /dev/null
+++ b/node_modules/pretty-hrtime/.npmignore
@@ -0,0 +1,10 @@
+.DS_Store
+*.log
+node_modules
+build
+*.node
+components
+*.orig
+.idea
+test
+.travis.yml
diff --git a/node_modules/pretty-hrtime/LICENSE b/node_modules/pretty-hrtime/LICENSE
new file mode 100644
index 000000000..b7346abd6
--- /dev/null
+++ b/node_modules/pretty-hrtime/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2013 [Richardson & Sons, LLC](http://richardsonandsons.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.
diff --git a/node_modules/pretty-hrtime/README.md b/node_modules/pretty-hrtime/README.md
new file mode 100644
index 000000000..f4be28ddf
--- /dev/null
+++ b/node_modules/pretty-hrtime/README.md
@@ -0,0 +1,57 @@
+[![Build Status](https://secure.travis-ci.org/robrich/pretty-hrtime.png?branch=master)](https://travis-ci.org/robrich/pretty-hrtime)
+[![Dependency Status](https://david-dm.org/robrich/pretty-hrtime.png)](https://david-dm.org/robrich/pretty-hrtime)
+
+pretty-hrtime
+============
+
+[process.hrtime()](http://nodejs.org/api/process.html#process_process_hrtime) to words
+
+Usage
+-----
+
+```javascript
+var prettyHrtime = require('pretty-hrtime');
+
+var start = process.hrtime();
+// do stuff
+var end = process.hrtime(start);
+
+var words = prettyHrtime(end);
+console.log(words); // '1.2 ms'
+
+words = prettyHrtime(end, {verbose:true});
+console.log(words); // '1 millisecond 209 microseconds'
+
+words = prettyHrtime(end, {precise:true});
+console.log(words); // '1.20958 ms'
+```
+
+Note: process.hrtime() has been available since 0.7.6.
+See [http://nodejs.org/changelog.html](http://nodejs.org/changelog.html)
+and [https://github.com/joyent/node/commit/f06abd](https://github.com/joyent/node/commit/f06abd).
+
+LICENSE
+-------
+
+(MIT License)
+
+Copyright (c) 2013 [Richardson & Sons, LLC](http://richardsonandsons.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.
diff --git a/node_modules/pretty-hrtime/index.js b/node_modules/pretty-hrtime/index.js
new file mode 100644
index 000000000..bed3f8994
--- /dev/null
+++ b/node_modules/pretty-hrtime/index.js
@@ -0,0 +1,80 @@
+/*jshint node:true */
+
+"use strict";
+
+var minimalDesc = ['h', 'min', 's', 'ms', 'μs', 'ns'];
+var verboseDesc = ['hour', 'minute', 'second', 'millisecond', 'microsecond', 'nanosecond'];
+var convert = [60*60, 60, 1, 1e6, 1e3, 1];
+
+module.exports = function (source, opts) {
+ var verbose, precise, i, spot, sourceAtStep, valAtStep, decimals, strAtStep, results, totalSeconds;
+
+ verbose = false;
+ precise = false;
+ if (opts) {
+ verbose = opts.verbose || false;
+ precise = opts.precise || false;
+ }
+
+ if (!Array.isArray(source) || source.length !== 2) {
+ return '';
+ }
+ if (typeof source[0] !== 'number' || typeof source[1] !== 'number') {
+ return '';
+ }
+
+ // normalize source array due to changes in node v5.4+
+ if (source[1] < 0) {
+ totalSeconds = source[0] + source[1] / 1e9;
+ source[0] = parseInt(totalSeconds);
+ source[1] = parseFloat((totalSeconds % 1).toPrecision(9)) * 1e9;
+ }
+
+ results = '';
+
+ // foreach unit
+ for (i = 0; i < 6; i++) {
+ spot = i < 3 ? 0 : 1; // grabbing first or second spot in source array
+ sourceAtStep = source[spot];
+ if (i !== 3 && i !== 0) {
+ sourceAtStep = sourceAtStep % convert[i-1]; // trim off previous portions
+ }
+ if (i === 2) {
+ sourceAtStep += source[1]/1e9; // get partial seconds from other portion of the array
+ }
+ valAtStep = sourceAtStep / convert[i]; // val at this unit
+ if (valAtStep >= 1) {
+ if (verbose) {
+ valAtStep = Math.floor(valAtStep); // deal in whole units, subsequent laps will get the decimal portion
+ }
+ if (!precise) {
+ // don't fling too many decimals
+ decimals = valAtStep >= 10 ? 0 : 2;
+ strAtStep = valAtStep.toFixed(decimals);
+ } else {
+ strAtStep = valAtStep.toString();
+ }
+ if (strAtStep.indexOf('.') > -1 && strAtStep[strAtStep.length-1] === '0') {
+ strAtStep = strAtStep.replace(/\.?0+$/,''); // remove trailing zeros
+ }
+ if (results) {
+ results += ' '; // append space if we have a previous value
+ }
+ results += strAtStep; // append the value
+ // append units
+ if (verbose) {
+ results += ' '+verboseDesc[i];
+ if (strAtStep !== '1') {
+ results += 's';
+ }
+ } else {
+ results += ' '+minimalDesc[i];
+ }
+ if (!verbose) {
+ break; // verbose gets as many groups as necessary, the rest get only one
+ }
+ }
+ }
+
+ return results;
+};
diff --git a/node_modules/pretty-hrtime/package.json b/node_modules/pretty-hrtime/package.json
new file mode 100644
index 000000000..fa39a3fff
--- /dev/null
+++ b/node_modules/pretty-hrtime/package.json
@@ -0,0 +1,95 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "pretty-hrtime@^1.0.0",
+ "scope": null,
+ "escapedName": "pretty-hrtime",
+ "name": "pretty-hrtime",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "/home/dold/repos/taler/wallet-webex/node_modules/gulp"
+ ]
+ ],
+ "_from": "pretty-hrtime@>=1.0.0 <2.0.0",
+ "_id": "pretty-hrtime@1.0.2",
+ "_inCache": true,
+ "_location": "/pretty-hrtime",
+ "_nodeVersion": "4.3.0",
+ "_npmOperationalInternal": {
+ "host": "packages-6-west.internal.npmjs.com",
+ "tmp": "tmp/pretty-hrtime-1.0.2.tgz_1455771577547_0.672698044218123"
+ },
+ "_npmUser": {
+ "name": "robrich",
+ "email": "robrich@robrich.org"
+ },
+ "_npmVersion": "2.14.18",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "pretty-hrtime@^1.0.0",
+ "scope": null,
+ "escapedName": "pretty-hrtime",
+ "name": "pretty-hrtime",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/gulp"
+ ],
+ "_resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.2.tgz",
+ "_shasum": "70ca96f4d0628a443b918758f79416a9a7bc9fa8",
+ "_shrinkwrap": null,
+ "_spec": "pretty-hrtime@^1.0.0",
+ "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp",
+ "author": {
+ "name": "Rob Richardson",
+ "url": "http://robrich.org/"
+ },
+ "bugs": {
+ "url": "https://github.com/robrich/pretty-hrtime/issues"
+ },
+ "dependencies": {},
+ "description": "process.hrtime() to words",
+ "devDependencies": {
+ "jshint": "^2.8.0",
+ "mocha": "^2.3.3",
+ "should": "^7.1.0"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "70ca96f4d0628a443b918758f79416a9a7bc9fa8",
+ "tarball": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.2.tgz"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "gitHead": "3ac6e19e8d9cc65e29ce9e45e81fc4f331d4a71a",
+ "homepage": "https://github.com/robrich/pretty-hrtime",
+ "keywords": [
+ "hrtime",
+ "benchmark"
+ ],
+ "license": "MIT",
+ "main": "./index.js",
+ "maintainers": [
+ {
+ "name": "robrich",
+ "email": "robrich@robrich.org"
+ }
+ ],
+ "name": "pretty-hrtime",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/robrich/pretty-hrtime.git"
+ },
+ "scripts": {
+ "test": "mocha && jshint ."
+ },
+ "version": "1.0.2"
+}