Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/a8m/clog
Pretty colorful cli logger for NodeJS(with table, success and more...)
https://github.com/a8m/clog
Last synced: about 1 month ago
JSON representation
Pretty colorful cli logger for NodeJS(with table, success and more...)
- Host: GitHub
- URL: https://github.com/a8m/clog
- Owner: a8m
- Created: 2014-09-28T20:20:38.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-16T21:39:27.000Z (about 10 years ago)
- Last Synced: 2024-04-26T01:22:26.488Z (7 months ago)
- Language: JavaScript
- Homepage: https://github.com/a8m/clog
- Size: 362 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# clog [![Build Status](https://travis-ci.org/a8m/clog.svg?branch=master)](https://travis-ci.org/a8m/clog) [![Coverage Status](https://img.shields.io/coveralls/a8m/clog.svg)](https://coveralls.io/r/a8m/clog?branch=master)
> Pretty colorful cli logger for NodeJS(with table, success and more...) **v0.0.3**
![Screenshot](https://raw.githubusercontent.com/a8m/clog/master/screenshot/table.jpg)
![Screenshot](https://raw.githubusercontent.com/a8m/clog/master/screenshot/logs.jpg)
![Screenshot](https://raw.githubusercontent.com/a8m/clog/master/screenshot/expections.jpg)
#[Installing](#installing)
###**git**
```bash
$ git clone https://github.com/a8m/clog.git
```
###**npm**
```bash
$ npm install c-log --save
```#[Usage](#usage)
```js
var clog = require('c-log');//Simple logs with colors
clog.log("Lorem Ipsum...");
clog.info("Lorem Ipsum...");
clog.warn("Lorem Ipsum ..");//Success and Error
function assert(expect, msg) {
return expect
? clog.success(msg)
: clog.error(msg);
}//Clog.time/timeEnd
clog.time("fsRead");
//fake async
setTimeout(function(){
logger.timeEnd("fsRead")
},2000);//Clog.table
var persons = [
{ name: 'Doris Fox', age: 20, isActive: false, balance: '$3,128.12' },
{ name: 'Mike Loks', age: 32, isActive: true, balance: '$12,132.1' },
{ name: 'Arle Sher', age: 12, isActive: false, balance: '$2,968.83' }
];
clog.table(persons);
/// Table Result:
╔═════════╤═══════════╤═════╤══════════╤═══════════╗
║ (index) │ name │ age │ isActive │ balance ║
╟─────────┼───────────┼─────┼──────────┼───────────╢
║ 0 │ Doris Fox │ 20 │ false │ $3,128.12 ║
╟─────────┼───────────┼─────┼──────────┼───────────╢
║ 1 │ Mike Loks │ 32 │ true │ $12,132.1 ║
╟─────────┼───────────┼─────┼──────────┼───────────╢
║ 2 │ Arle Sher │ 12 │ false │ $2,968.83 ║
╚═════════╧═══════════╧═════╧══════════╧═══════════╝
```
#[License](#license)
MIT © [Ariel Mashraki](https://github.com/a8m)