# better-console

> A better console for Node.js

Latest version **1.0.1** (published 2017-10-22) · BSD license · 0 weekly downloads

## Install

```sh
npm install better-console
pnpm add better-console
yarn add better-console
bun add better-console
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-10-22 |
| First published | 2013-06-20 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 112 |
| Author | Mohsen Azimi |
| Maintainers | mohsen |
| Keywords | console |

## Links

- npm: https://www.npmjs.com/package/better-console
- Repository: https://github.com/mohsen1/better-console
- Homepage: https://github.com/mohsen1/better-console#readme
- Issues: https://github.com/mohsen1/better-console/issues
- npm.io page: https://npm.io/package/better-console

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [cli-table](https://npm.io/package/cli-table.md) ~0.3.1

## Recent versions

- 1.0.1 (latest) — 2017-10-22
- 1.0.0 — 2017-01-06
- 0.2.4 — 2015-02-27
- 0.2.3 — 2014-05-08
- 0.2.2 — 2013-06-29
- 0.2.1 — 2013-06-29
- 0.2.0 — 2013-06-28
- 0.1.2 — 2013-06-21
- 0.1.1 — 2013-06-20
- 0.1.0 — 2013-06-20

## README

# Better Console

![Screenshot](https://raw.github.com/mohsen1/better-console/master/screenshot.png)

## Installation

Use NPM

```shell
$ npm install better-console
```

## A better console for Node.js


`better-console` is a drop-in replacement for node's default console which
gives you colors and more methods in console.

## How to use it

You can override `console` object itself or assign better console to another variable. It's completely safe to override the native console object because better console calls native console methods for methods that are already available in it.

```
var console = require('better-console');

console.log("This is a log information");
console.warn("Warning!");
console.info("Information");
console.table([ [1,2], [3,4] ]);
console.time("Timer");
console.timeEnd("Timer");
console.dir(myObject);

```

## Methods

### `console.log`, `console.warn`, `console.error`, `console.info`, `console.debug`, `console.dir`, `console.trace`
These methods work exactly same as native console methods but with colors for `warn`, `info` or `error`

### `console.clear`

Clears the screen

### `console.table`

Draws a table of data if a 2d array or object passed to it

### `console.time`

Creates a new timer under the given name. Call `console.timeEnd(name)`
 with the same name to stop the timer and print the time elapsed.

### `console.timeEnd`

Stops a timer created by a call to console.time(name) and write the time

### `console.trace`

Prints a stack trace of JavaScript execution at the point
where it is called. The stack trace details the functions on the stack,
as well as the values that were passed as arguments to each function.

### `console.count`

Writes number of times each argument is called with blue color

## TODOs

 * Use Unicode icons to mimic browser console icons in OSX
 * Make `console.trace` more detailed with V8 flags

---
_Source: https://npm.io/package/better-console · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
