aboutsummaryrefslogtreecommitdiff
path: root/node_modules/pretty-ms
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
commitcc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch)
tree92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/pretty-ms
parent3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff)
remove node_modules
Diffstat (limited to 'node_modules/pretty-ms')
-rw-r--r--node_modules/pretty-ms/index.js49
-rw-r--r--node_modules/pretty-ms/license9
-rw-r--r--node_modules/pretty-ms/package.json47
-rw-r--r--node_modules/pretty-ms/readme.md99
4 files changed, 0 insertions, 204 deletions
diff --git a/node_modules/pretty-ms/index.js b/node_modules/pretty-ms/index.js
deleted file mode 100644
index 5a5f15e5a..000000000
--- a/node_modules/pretty-ms/index.js
+++ /dev/null
@@ -1,49 +0,0 @@
-'use strict';
-const parseMs = require('parse-ms');
-
-const plur = (word, count) => count === 1 ? word : word + 's';
-
-module.exports = (ms, opts) => {
- if (!Number.isFinite(ms)) {
- throw new TypeError('Expected a finite number');
- }
-
- opts = opts || {};
-
- if (ms < 1000) {
- const msDecimalDigits = typeof opts.msDecimalDigits === 'number' ? opts.msDecimalDigits : 0;
- return (msDecimalDigits ? ms.toFixed(msDecimalDigits) : Math.ceil(ms)) + (opts.verbose ? ' ' + plur('millisecond', Math.ceil(ms)) : 'ms');
- }
-
- const ret = [];
-
- const add = (val, long, short, valStr) => {
- if (val === 0) {
- return;
- }
-
- const postfix = opts.verbose ? ' ' + plur(long, val) : short;
-
- ret.push((valStr || val) + postfix);
- };
-
- const parsed = parseMs(ms);
-
- add(Math.trunc(parsed.days / 365), 'year', 'y');
- add(parsed.days % 365, 'day', 'd');
- add(parsed.hours, 'hour', 'h');
- add(parsed.minutes, 'minute', 'm');
-
- if (opts.compact) {
- add(parsed.seconds, 'second', 's');
- return '~' + ret[0];
- }
-
- const sec = ms / 1000 % 60;
- const secDecimalDigits = typeof opts.secDecimalDigits === 'number' ? opts.secDecimalDigits : 1;
- const secFixed = sec.toFixed(secDecimalDigits);
- const secStr = opts.keepDecimalsOnWholeSeconds ? secFixed : secFixed.replace(/\.0+$/, '');
- add(sec, 'second', 's', secStr);
-
- return ret.join(' ');
-};
diff --git a/node_modules/pretty-ms/license b/node_modules/pretty-ms/license
deleted file mode 100644
index e7af2f771..000000000
--- a/node_modules/pretty-ms/license
+++ /dev/null
@@ -1,9 +0,0 @@
-MIT License
-
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-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-ms/package.json b/node_modules/pretty-ms/package.json
deleted file mode 100644
index 4dd01677e..000000000
--- a/node_modules/pretty-ms/package.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "name": "pretty-ms",
- "version": "3.2.0",
- "description": "Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`",
- "license": "MIT",
- "repository": "sindresorhus/pretty-ms",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "engines": {
- "node": ">=4"
- },
- "scripts": {
- "test": "xo && ava"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "pretty",
- "prettify",
- "human",
- "humanize",
- "humanized",
- "readable",
- "time",
- "ms",
- "milliseconds",
- "duration",
- "period",
- "range",
- "text",
- "string",
- "str",
- "number",
- "hrtime"
- ],
- "dependencies": {
- "parse-ms": "^1.0.0"
- },
- "devDependencies": {
- "ava": "*",
- "xo": "*"
- }
-}
diff --git a/node_modules/pretty-ms/readme.md b/node_modules/pretty-ms/readme.md
deleted file mode 100644
index 01bab490b..000000000
--- a/node_modules/pretty-ms/readme.md
+++ /dev/null
@@ -1,99 +0,0 @@
-# pretty-ms [![Build Status](https://travis-ci.org/sindresorhus/pretty-ms.svg?branch=master)](https://travis-ci.org/sindresorhus/pretty-ms)
-
-> Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`
-
-
-## Usage
-
-```
-$ npm install pretty-ms
-```
-
-```js
-const prettyMs = require('pretty-ms');
-
-prettyMs(1337000000);
-//=> '15d 11h 23m 20s'
-
-prettyMs(1337);
-//=> '1.3s'
-
-prettyMs(133);
-//=> '133ms'
-
-// compact option
-prettyMs(1337, {compact: true});
-//=> '~1s'
-
-// verbose option
-prettyMs(1335669000, {verbose: true});
-//=> '15 days 11 hours 1 minute 9 seconds'
-
-// can be useful for time durations
-prettyMs(new Date(2014, 0, 1, 10, 40) - new Date(2014, 0, 1, 10, 5))
-//=> '35m'
-```
-
-
-## API
-
-### prettyMs(input, [options])
-
-#### input
-
-Type: `number`
-
-Milliseconds to humanize.
-
-#### options
-
-Type: `Object`
-
-##### secDecimalDigits
-
-Type: `number`<br>
-Default: `1`
-
-Number of digits to appear after the seconds decimal point.
-
-##### msDecimalDigits
-
-Type: `number`<br>
-Default: `0`
-
-Number of digits to appear after the milliseconds decimal point.
-
-Useful in combination with [`process.hrtime()`](https://nodejs.org/api/process.html#process_process_hrtime).
-
-##### keepDecimalsOnWholeSeconds
-
-Type: `boolean`<br>
-Default: `false`
-
-Keep milliseconds on whole seconds: `13s` → `13.0s`.
-
-Useful when you are showing a number of seconds spent on an operation and don't want the width of the output to change when hitting a whole number.
-
-##### compact
-
-Type: `boolean`<br>
-Default: `false`
-
-Only show the first unit: `1h 10m` → `~1h`.
-
-##### verbose
-
-Type: `boolean`<br>
-Default: `false`
-
-Use full-length units: `5h 1m 45s` → `5 hours 1 minute 45 seconds`
-
-
-## Related
-
-- [pretty-ms-cli](https://github.com/sindresorhus/pretty-ms-cli) - CLI for this module
-
-
-## License
-
-MIT © [Sindre Sorhus](https://sindresorhus.com)