https://github.com/frux/logs-time
Prepends timestamp to all your console outputs
https://github.com/frux/logs-time
Last synced: 4 months ago
JSON representation
Prepends timestamp to all your console outputs
- Host: GitHub
- URL: https://github.com/frux/logs-time
- Owner: frux
- Created: 2015-12-17T09:30:10.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-21T11:39:39.000Z (over 10 years ago)
- Last Synced: 2025-10-21T09:38:37.605Z (8 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# logs-time
Prepends timestamp to all your console outputs
## Usage
```js
require('logs-time')('[HH:MM:ss] ');
console.log('test'); //-> [14:31:53] test
console.error('error'); //-> [14:31:53] error
process.stdout.write('test stdout'); //-> [14:31:53] test stdout
process.stdout.write('test stderr'); //-> [14:31:53] test stderr
```
## Date formats
`logs-time` is using [dateformat](https://github.com/felixge/node-dateformat) module. Therefore it supports dates patterns described [there](http://blog.stevenlevithan.com/archives/date-time-format).