Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vhf/log-anything
A dead simple JS debug/logging utility
https://github.com/vhf/log-anything
Last synced: 13 days ago
JSON representation
A dead simple JS debug/logging utility
- Host: GitHub
- URL: https://github.com/vhf/log-anything
- Owner: vhf
- Created: 2015-12-12T15:04:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-03T17:12:41.000Z (about 8 years ago)
- Last Synced: 2024-10-16T19:23:33.727Z (28 days ago)
- Language: JavaScript
- Size: 26.4 KB
- Stars: 1
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# log-anything
`log-anything` is a dead simple JS debug/logging utility
# Usage
```shell
npm install log-anything
```Then require it.
```javascript
const l = require('log-anything');const obj = { a: 1, b: 2, c: 3 };
// log displays values
l.log('obj is', obj, 'and this is an array:', [3, 2, 1]);
// obj is { a: 1, b: 2, c: 3 } and this is an array: [ 3, 2, 1 ]var xs = [
['ops/sec', 'name', '(comment)'],
[520.56, 'algo 1'],
['9.99', 'two', 'strange'],
[10, 'third one'],
['nine thousand', 'NaN', 'fun!'],
];
// logt displays a table
l.logt(xs);
/*
ops/sec name (comment)
520.56 algo 1
9.99 two strange
10 third one
nine thousand NaN fun!
*/
```