@node-cli/timer 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +35 -0
- package/dist/defaults.d.ts +4 -0
- package/dist/defaults.js +6 -0
- package/dist/defaults.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/parse.d.ts +9 -0
- package/dist/parse.js +47 -0
- package/dist/parse.js.map +1 -0
- package/dist/timer.d.ts +2 -0
- package/dist/timer.js +7 -0
- package/dist/timer.js.map +1 -0
- package/dist/utilities.d.ts +14 -0
- package/dist/utilities.js +89 -0
- package/dist/utilities.js.map +1 -0
- package/package.json +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Arno Versini
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Node CLI timer package
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
> Timer is a dead simple command line tool to display the remaining time for a given duration.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
> npm install --global @node-cli/timer
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
Start a timer for 4 hours, 2 minutes and 15 seconds
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
> timer 4h2m15s
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Start a timer for 1 minute and 42 seconds
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
> timer 1m42s
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Get help
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
> search --help
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
MIT © Arno Versini
|
package/dist/defaults.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/defaults.ts"],"sourcesContent":["/* istanbul ignore file */\nexport const defaultFlags = {\n\tboring: false,\n\tnotification: true,\n};\n"],"names":["defaultFlags","boring","notification"],"mappings":"AAAA,wBAAwB,GACxB,OAAO,MAAMA,eAAe;IAC3BC,QAAQ;IACRC,cAAc;AACf,EAAE"}
|
package/dist/index.d.ts
ADDED
package/dist/parse.d.ts
ADDED
package/dist/parse.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defaultFlags } from "./defaults.js";
|
|
2
|
+
import { parser } from "@node-cli/parser";
|
|
3
|
+
/* istanbul ignore next */ export const config = parser({
|
|
4
|
+
meta: import.meta,
|
|
5
|
+
examples: [
|
|
6
|
+
{
|
|
7
|
+
command: "timer 4h2m15s",
|
|
8
|
+
comment: "## Start a timer for 4 hours, 2 minutes and 15 seconds"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
command: "timer 1m42s",
|
|
12
|
+
comment: "## Start a timer for 1 minute and 42 seconds"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
flags: {
|
|
16
|
+
boring: {
|
|
17
|
+
shortFlag: "b",
|
|
18
|
+
default: defaultFlags.boring,
|
|
19
|
+
description: "Do not use color output",
|
|
20
|
+
type: "boolean"
|
|
21
|
+
},
|
|
22
|
+
help: {
|
|
23
|
+
shortFlag: "h",
|
|
24
|
+
description: "Display help instructions",
|
|
25
|
+
type: "boolean"
|
|
26
|
+
},
|
|
27
|
+
notification: {
|
|
28
|
+
shortFlag: "n",
|
|
29
|
+
default: defaultFlags.notification,
|
|
30
|
+
description: "Display a notification when the timer is done",
|
|
31
|
+
type: "boolean"
|
|
32
|
+
},
|
|
33
|
+
version: {
|
|
34
|
+
shortFlag: "v",
|
|
35
|
+
description: "Output the current version",
|
|
36
|
+
type: "boolean"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
parameters: {
|
|
40
|
+
formattedTime: {
|
|
41
|
+
description: "Formatted time to start the timer"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
usage: "timer [formattedTime]"
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=parse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/parse.ts"],"sourcesContent":["import { defaultFlags } from \"./defaults.js\";\nimport { parser } from \"@node-cli/parser\";\n\nexport type Parameters = {\n\t[\"0\"]?: string;\n};\nexport type Configuration = {\n\tflags?: any;\n\tparameters?: Parameters;\n\tshowHelp?: () => void;\n};\n\n/* istanbul ignore next */\nexport const config: Configuration = parser({\n\tmeta: import.meta,\n\texamples: [\n\t\t{\n\t\t\tcommand: \"timer 4h2m15s\",\n\t\t\tcomment: \"## Start a timer for 4 hours, 2 minutes and 15 seconds\",\n\t\t},\n\t\t{\n\t\t\tcommand: \"timer 1m42s\",\n\t\t\tcomment: \"## Start a timer for 1 minute and 42 seconds\",\n\t\t},\n\t],\n\tflags: {\n\t\tboring: {\n\t\t\tshortFlag: \"b\",\n\t\t\tdefault: defaultFlags.boring,\n\t\t\tdescription: \"Do not use color output\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\thelp: {\n\t\t\tshortFlag: \"h\",\n\t\t\tdescription: \"Display help instructions\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tnotification: {\n\t\t\tshortFlag: \"n\",\n\t\t\tdefault: defaultFlags.notification,\n\t\t\tdescription: \"Display a notification when the timer is done\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\tversion: {\n\t\t\tshortFlag: \"v\",\n\t\t\tdescription: \"Output the current version\",\n\t\t\ttype: \"boolean\",\n\t\t},\n\t},\n\tparameters: {\n\t\tformattedTime: {\n\t\t\tdescription: \"Formatted time to start the timer\",\n\t\t},\n\t},\n\n\tusage: \"timer [formattedTime]\",\n});\n"],"names":["defaultFlags","parser","config","meta","examples","command","comment","flags","boring","shortFlag","default","description","type","help","notification","version","parameters","formattedTime","usage"],"mappings":"AAAA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,MAAM,QAAQ,mBAAmB;AAW1C,wBAAwB,GACxB,OAAO,MAAMC,SAAwBD,OAAO;IAC3CE,MAAM;IACNC,UAAU;QACT;YACCC,SAAS;YACTC,SAAS;QACV;QACA;YACCD,SAAS;YACTC,SAAS;QACV;KACA;IACDC,OAAO;QACNC,QAAQ;YACPC,WAAW;YACXC,SAASV,aAAaQ;YACtBG,aAAa;YACbC,MAAM;QACP;QACAC,MAAM;YACLJ,WAAW;YACXE,aAAa;YACbC,MAAM;QACP;QACAE,cAAc;YACbL,WAAW;YACXC,SAASV,aAAac;YACtBH,aAAa;YACbC,MAAM;QACP;QACAG,SAAS;YACRN,WAAW;YACXE,aAAa;YACbC,MAAM;QACP;IACD;IACAI,YAAY;QACXC,eAAe;YACdN,aAAa;QACd;IACD;IAEAO,OAAO;AACR,GAAG"}
|
package/dist/timer.d.ts
ADDED
package/dist/timer.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/timer.ts"],"sourcesContent":["#!/usr/bin/env node\n/* istanbul ignore file */\n\nimport { Timer } from \"./utilities.js\";\nimport { config } from \"./parse.js\";\n\nconst timer = new Timer(config);\ntimer.start();\n"],"names":["Timer","config","timer","start"],"mappings":";AACA,wBAAwB,GAExB,SAASA,KAAK,QAAQ,iBAAiB;AACvC,SAASC,MAAM,QAAQ,aAAa;AAEpC,MAAMC,QAAQ,IAAIF,MAAMC;AACxBC,MAAMC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Duration } from "moment";
|
|
2
|
+
import { Configuration } from "./parse.js";
|
|
3
|
+
export declare const timeToMicroseconds: (value: string, unit: string) => number;
|
|
4
|
+
export declare const extractDuration: (config: Configuration) => Duration;
|
|
5
|
+
export declare class Timer {
|
|
6
|
+
config: Configuration;
|
|
7
|
+
startTime: number;
|
|
8
|
+
timerDurationMilliSeconds: number;
|
|
9
|
+
introMessage: string;
|
|
10
|
+
timerDurationSeconds: number;
|
|
11
|
+
constructor(config: Configuration);
|
|
12
|
+
start: () => void;
|
|
13
|
+
private printRemainingTime;
|
|
14
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Logger, Spinner } from "@node-cli/logger";
|
|
2
|
+
import moment from "moment";
|
|
3
|
+
import notifier from "node-notifier";
|
|
4
|
+
const logger = new Logger();
|
|
5
|
+
const spinner = new Spinner();
|
|
6
|
+
const UNITS = {
|
|
7
|
+
ms: 1000,
|
|
8
|
+
s: 1000 * 1000,
|
|
9
|
+
m: 1000 * 1000 * 60,
|
|
10
|
+
h: 1000 * 1000 * 60 * 60,
|
|
11
|
+
d: 1000 * 1000 * 60 * 60 * 24,
|
|
12
|
+
w: 1000 * 1000 * 60 * 60 * 24 * 7
|
|
13
|
+
};
|
|
14
|
+
export const timeToMicroseconds = (value, unit)=>{
|
|
15
|
+
const result = UNITS[unit];
|
|
16
|
+
return result ? Number.parseInt(value, 10) * result : 0;
|
|
17
|
+
};
|
|
18
|
+
export const extractDuration = (config)=>{
|
|
19
|
+
const { parameters , showHelp } = config;
|
|
20
|
+
let totalMicroseconds = 0;
|
|
21
|
+
/* istanbul ignore if */ if (Object.entries(parameters).length === 0 || Object.entries(parameters).length > 1) {
|
|
22
|
+
showHelp();
|
|
23
|
+
}
|
|
24
|
+
const groups = parameters["0"].toLowerCase().match(/[+-]?[\d.]+[a-z]+/g);
|
|
25
|
+
/* istanbul ignore if */ if (groups === null) {
|
|
26
|
+
showHelp();
|
|
27
|
+
} else {
|
|
28
|
+
for (const g of groups){
|
|
29
|
+
const value = g.match(/[\d.]+/g)[0];
|
|
30
|
+
const unit = g.match(/[a-z]+/g)[0];
|
|
31
|
+
totalMicroseconds += timeToMicroseconds(value, unit);
|
|
32
|
+
}
|
|
33
|
+
return moment.duration(totalMicroseconds / UNITS.ms);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
/* istanbul ignore next */ export class Timer {
|
|
37
|
+
config;
|
|
38
|
+
startTime;
|
|
39
|
+
timerDurationMilliSeconds;
|
|
40
|
+
introMessage;
|
|
41
|
+
timerDurationSeconds;
|
|
42
|
+
constructor(config){
|
|
43
|
+
this.config = config;
|
|
44
|
+
const result = extractDuration(this.config);
|
|
45
|
+
this.timerDurationMilliSeconds = result.asMilliseconds();
|
|
46
|
+
this.timerDurationSeconds = result.asSeconds();
|
|
47
|
+
this.introMessage = `${result.hours()}h ${result.minutes()}m ${result.seconds()}s`;
|
|
48
|
+
}
|
|
49
|
+
start = ()=>{
|
|
50
|
+
if (this.timerDurationMilliSeconds > 0) {
|
|
51
|
+
logger.printBox(`${this.introMessage} `, {
|
|
52
|
+
padding: 0,
|
|
53
|
+
borderColor: "cyan",
|
|
54
|
+
title: "Timer Configuration"
|
|
55
|
+
});
|
|
56
|
+
this.startTime = Date.now();
|
|
57
|
+
spinner.start(this.introMessage);
|
|
58
|
+
// update the spinner every second
|
|
59
|
+
this.printRemainingTime();
|
|
60
|
+
const timer = setInterval(this.printRemainingTime, 1000);
|
|
61
|
+
// kill the spinner when the timer is done
|
|
62
|
+
setTimeout(()=>{
|
|
63
|
+
const message = "Time's up!";
|
|
64
|
+
if (this.config.flags.notification) {
|
|
65
|
+
notifier.notify({
|
|
66
|
+
message,
|
|
67
|
+
sound: "Funk",
|
|
68
|
+
title: "Timer Notification",
|
|
69
|
+
wait: true
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
clearInterval(timer);
|
|
73
|
+
this.printRemainingTime(message);
|
|
74
|
+
spinner.stop();
|
|
75
|
+
}, this.timerDurationMilliSeconds);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
printRemainingTime = (message)=>{
|
|
79
|
+
if (message) {
|
|
80
|
+
spinner.text = message;
|
|
81
|
+
} else {
|
|
82
|
+
const elapsed = (Date.now() - this.startTime) / 1000;
|
|
83
|
+
const duration = moment.duration((this.timerDurationSeconds - elapsed) * 1000);
|
|
84
|
+
spinner.text = `${duration.hours()}h ${duration.minutes()}m ${duration.seconds()}s`;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=utilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utilities.ts"],"sourcesContent":["import { Logger, Spinner } from \"@node-cli/logger\";\nimport moment, { Duration } from \"moment\";\n\nimport { Configuration } from \"./parse.js\";\nimport notifier from \"node-notifier\";\n\nconst logger = new Logger();\nconst spinner = new Spinner();\n\nconst UNITS = {\n\tms: 1000,\n\ts: 1000 * 1000,\n\tm: 1000 * 1000 * 60,\n\th: 1000 * 1000 * 60 * 60,\n\td: 1000 * 1000 * 60 * 60 * 24,\n\tw: 1000 * 1000 * 60 * 60 * 24 * 7,\n};\n\nexport const timeToMicroseconds = (value: string, unit: string) => {\n\tconst result = UNITS[unit];\n\treturn result ? Number.parseInt(value, 10) * result : 0;\n};\n\nexport const extractDuration = (config: Configuration): Duration => {\n\tconst { parameters, showHelp } = config;\n\tlet totalMicroseconds = 0;\n\n\t/* istanbul ignore if */\n\tif (\n\t\tObject.entries(parameters).length === 0 ||\n\t\tObject.entries(parameters).length > 1\n\t) {\n\t\tshowHelp();\n\t}\n\n\tconst groups = parameters[\"0\"].toLowerCase().match(/[+-]?[\\d.]+[a-z]+/g);\n\n\t/* istanbul ignore if */\n\tif (groups === null) {\n\t\tshowHelp();\n\t} else {\n\t\tfor (const g of groups) {\n\t\t\tconst value = g.match(/[\\d.]+/g)[0];\n\t\t\tconst unit = g.match(/[a-z]+/g)[0];\n\t\t\ttotalMicroseconds += timeToMicroseconds(value, unit);\n\t\t}\n\t\treturn moment.duration(totalMicroseconds / UNITS.ms);\n\t}\n};\n\n/* istanbul ignore next */\nexport class Timer {\n\tconfig: Configuration;\n\tstartTime: number;\n\ttimerDurationMilliSeconds: number;\n\tintroMessage: string;\n\ttimerDurationSeconds: number;\n\n\tconstructor(config: Configuration) {\n\t\tthis.config = config;\n\t\tconst result: Duration = extractDuration(this.config);\n\t\tthis.timerDurationMilliSeconds = result.asMilliseconds();\n\t\tthis.timerDurationSeconds = result.asSeconds();\n\t\tthis.introMessage = `${result.hours()}h ${result.minutes()}m ${result.seconds()}s`;\n\t}\n\n\tstart = () => {\n\t\tif (this.timerDurationMilliSeconds > 0) {\n\t\t\tlogger.printBox(`${this.introMessage} `, {\n\t\t\t\tpadding: 0,\n\t\t\t\tborderColor: \"cyan\",\n\t\t\t\ttitle: \"Timer Configuration\",\n\t\t\t});\n\n\t\t\tthis.startTime = Date.now();\n\t\t\tspinner.start(this.introMessage);\n\n\t\t\t// update the spinner every second\n\t\t\tthis.printRemainingTime();\n\t\t\tconst timer = setInterval(this.printRemainingTime, 1000);\n\n\t\t\t// kill the spinner when the timer is done\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst message = \"Time's up!\";\n\t\t\t\tif (this.config.flags.notification) {\n\t\t\t\t\tnotifier.notify({\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t\tsound: \"Funk\",\n\t\t\t\t\t\ttitle: \"Timer Notification\",\n\t\t\t\t\t\twait: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tclearInterval(timer);\n\t\t\t\tthis.printRemainingTime(message);\n\t\t\t\tspinner.stop();\n\t\t\t}, this.timerDurationMilliSeconds);\n\t\t}\n\t};\n\n\tprivate printRemainingTime = (message: string | void) => {\n\t\tif (message) {\n\t\t\tspinner.text = message;\n\t\t} else {\n\t\t\tconst elapsed = (Date.now() - this.startTime) / 1000;\n\t\t\tconst duration = moment.duration(\n\t\t\t\t(this.timerDurationSeconds - elapsed) * 1000\n\t\t\t);\n\t\t\tspinner.text = `${duration.hours()}h ${duration.minutes()}m ${duration.seconds()}s`;\n\t\t}\n\t};\n}\n"],"names":["Logger","Spinner","moment","notifier","logger","spinner","UNITS","ms","s","m","h","d","w","timeToMicroseconds","value","unit","result","Number","parseInt","extractDuration","config","parameters","showHelp","totalMicroseconds","Object","entries","length","groups","toLowerCase","match","g","duration","Timer","startTime","timerDurationMilliSeconds","introMessage","timerDurationSeconds","constructor","asMilliseconds","asSeconds","hours","minutes","seconds","start","printBox","padding","borderColor","title","Date","now","printRemainingTime","timer","setInterval","setTimeout","message","flags","notification","notify","sound","wait","clearInterval","stop","text","elapsed"],"mappings":"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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@node-cli/timer",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"author": "Arno Versini",
|
|
6
|
+
"description": "Dead simpler CLI timer",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": "./dist/timer.js",
|
|
10
|
+
"bin": {
|
|
11
|
+
"timer": "dist/timer.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"node": ">=16",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "yarn run clean && yarn run build:types && yarn run build:js && yarn run build:barrel",
|
|
19
|
+
"build:barrel": "barrelsby --delete --directory dist --pattern \"**/*.d.ts\" --name \"index.d\"",
|
|
20
|
+
"build:js": "swc --source-maps --out-dir dist src",
|
|
21
|
+
"build:types": "tsc",
|
|
22
|
+
"clean": "rimraf dist types coverage",
|
|
23
|
+
"lint": "prettier --write \"src/*.ts\" && eslint --fix \"src/*.ts\"",
|
|
24
|
+
"test": "cross-env-shell NODE_OPTIONS=--experimental-vm-modules TZ=UTC jest",
|
|
25
|
+
"test:coverage": "npm run test -- --coverage",
|
|
26
|
+
"watch": "swc --watch --out-dir dist src"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@node-cli/logger": ">=1.0.0",
|
|
30
|
+
"@node-cli/parser": ">=2.0.0",
|
|
31
|
+
"moment": "2.29.4",
|
|
32
|
+
"node-notifier": "10.0.1"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"gitHead": "04fc495165a21ef51a94175dac632e733759eab4"
|
|
38
|
+
}
|