Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
[![npm](http://img.shields.io/npm/v/consolate.svg)](https://www.npmjs.org/package/consolate)
[![travis](https://travis-ci.org/rollercodester/consolate.svg?branch=master)](https://travis-ci.org/rollercodester/consolate)
[![Dependency Status](https://david-dm.org/rollercodester/consolate.svg)](https://david-dm.org/rollercodester/consolate)

# consolate
#### Customize your Node.JS console like a dignitary.
Easily create intuitive log functions on the console object—even override built-in console functions (error, info, warn, etc.) And while you're at it, feel free to easily define colors, prefixes, and bullets that can automatically animate [cli-cursors](https://www.npmjs.com/package/cli-spinners).

![examples/6-cicd-pipeline.js](https://cloud.githubusercontent.com/assets/1450389/23842310/a584cdfc-0770-11e7-8969-f2d6659ca41a.gif)

## Index

* [Examples](#examples)
	* [Super-simple Custom Console Method](#example1)
	* [Overriding Built-in Console Methods](#example2)
	* [Animated vs Static Bullets](#example3)
	* [Smart Log Argument Handling](#example4)
	* [Apollo 11](#example5)
	* [CI/CD Pipeline Console](#example6)
* [API Reference](#api)

<a name="examples"></a>

## Examples

<h3><a name="example1" href='https://github.com/rollercodester/consolate/blob/master/examples/1-simple-custom-method.js'>Super-simple Custom Console Method</a></h3>

![examples/1-simple-custom-method.js](https://cloud.githubusercontent.com/assets/1450389/23828435/20fe2f50-0686-11e7-962f-fbf2702ea259.gif)

```javascript
var consolate = require('consolate')

consolate.init({
   arrow: {
      color: consolate.colors.cyan,
      prefix: {
         chars: '>>>>>----->',
         color: consolate.colors.lightCyan
      }
   }
})

console.arrow('My customized "arrow" log method!')

setTimeout(() => {
	console.arrow('Just think of the possibilities :-)')
}, 1500)

setTimeout(() => {
	console.arrow('And we haven\'t even scratched the surface.')
}, 3000)

setTimeout(() => {
	console.arrow('Okay, one more time before moving on.')
	console.log()
}, 4500)
```

<h3><a name="example2" href='https://github.com/rollercodester/consolate/blob/master/examples/2-console-overrides-on-built-in-methods.js'>Overriding Built-in Console Methods</a></h3>

![examples/2-console-overrides-on-built-in-methods.js](https://cloud.githubusercontent.com/assets/1450389/23828470/7610d2f8-0687-11e7-8410-fdf2b567775a.gif)


<h3><a name="example3" href='https://github.com/rollercodester/consolate/blob/master/examples/3-animated-and-static-bullets.js'>Animated vs Static Bullets</a></h3>

![examples/3-animated-and-static-bullets.js](https://cloud.githubusercontent.com/assets/1450389/23828520/e8a89fd4-0688-11e7-9c95-aa3959920f46.gif)


<h3><a name="example4" href='https://github.com/rollercodester/consolate/blob/master/examples/4-smart-log-argument-handling.js'>Smart Log Argument Handling</a></h3>

![examples/4-smart-log-argument-handling.js](https://cloud.githubusercontent.com/assets/1450389/23831679/bd7c44d6-06e3-11e7-9e8c-087b0b996a75.gif)


<h3><a name="example5" href='https://github.com/rollercodester/consolate/blob/master/examples/5-apollo-11.js'>Apollo 11</a></h3>

![examples/5-apollo-11.js](https://cloud.githubusercontent.com/assets/1450389/23831850/6751c74a-06e6-11e7-8340-66e53124a7c0.gif)


<h3><a name="example6" href='https://github.com/rollercodester/consolate/blob/master/examples/6-cicd-pipeline.js'>CI/CD Pipeline Console</a></h3>

![examples/6-cicd-pipeline.js](https://cloud.githubusercontent.com/assets/1450389/23842310/a584cdfc-0770-11e7-8969-f2d6659ca41a.gif)


<a name="api"></a>

## API Reference
{{#module name="consolate"}}
{{>body~}}
{{>members~}}
{{/module}}