# better-log

> console.log wrapper for a bit more readable output

Latest version **1.3.3** (published 2015-07-26) · MIT license · 0 weekly downloads

## Install

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

## 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.3.3 |
| Published | 2015-07-26 |
| First published | 2015-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 204 |
| Author | Ingvar Stepanyan |
| Maintainers | rreverser |
| Keywords | console, log, readability, inspect |

## Links

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

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.3.3 (latest) — 2015-07-26
- 1.3.2 — 2015-07-25
- 1.3.1 — 2015-07-04
- 1.3.0 — 2015-07-03
- 1.2.0 — 2015-06-06
- 1.1.0 — 2015-05-22
- 1.0.0 — 2015-05-22
- 0.0.0 — 2015-05-22

## README

# better-log

console.log wrapper for a bit more readable output in Node.js

Tired of seeing hardly readable outputs like this?

![regular console.log](https://pbs.twimg.com/media/CFmZABUW0AAqAIK.png)

Replace them with something more elegant!

![better log](https://pbs.twimg.com/media/CFmZBRnWoAABjJi.png)

## Usage

### Patching built-in `console` (API is 100% compatible)

```javascript
require('better-log/install'); // ES6: import 'better-log/install';
console.log({ x: 1, y: 'prop' });
console.error('Something bad happened :(');
```

or

```javascript
require('better-log').install({ depth: 2 }); // optional config
console.log({ x: 1, y: 'prop' });
console.error('Something bad happened :(');
```

#### Restoring native `console.log`:

```javascript
require('better-log').uninstall();
```

### Manual usage as a regular function

```javascript
var log = require('better-log')/* .setConfig({ depth: 2 }) */;
log({ x: 1, y: 'prop' });
log.error('Something bad happened :(');
```

That's it!

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