lgtime
v1.1.5
Published
``` let logTime = require('lgtime')
Downloads
42
Readme
About
let logTime = require('lgtime')
logTime({m:10}) // Mon 29 Jul 12:20PM (every 10m sharp)
logTime({m:10}, {m:0}) // Mon 29 Jul 12PM (every 10m sharp)
logTime({m:10}, {y:1}) // 2024 Mon 29 Jul 12:20PM (every 10m sharp)
logTime({h:1}) // Mon 29 Jul 12:00PM (every 1h sharp)
logTime({s:10}, {y:1}) // 2024 Mon 29 Jul 12:00:20PM (every 10s sharp)
logTime({s:10}, {}, (v)=>{console.log('now:'+v)}) // now: Mon 29 Jul 12:00PM // custom logging style
Parameters
logTime({interval}, {output}, cb)
- interval
- s: seconds interval
- m: minutes interval
- h: hours interval
- default: m:10
- output: object, refer https://www.npmjs.com/package/ytodate
- y: year, default 0 //1: 7/29/2024, 9:37:00 PM //0: Mon 29 Jul 9:44PM
- m: minute; default 1 //1: Mon 29 Jul 9:44PM //0: Mon 29 Jul 9PM
- accept empty object or FALSE value (0, empty, ..), to continue next cb argument
- cb: callback for custom logging style