# pretty.dump

> Provides a better dump function to visualize data in the terminal.

Latest version **0.0.1** (published 2017-08-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install pretty.dump
pnpm add pretty.dump
yarn add pretty.dump
bun add pretty.dump
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-08-29 |
| First published | 2017-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Olavo Amorim Santos |
| Maintainers | olavo.a.santos |

## Links

- npm: https://www.npmjs.com/package/pretty.dump
- Repository: https://github.com/olavoasantos/pretty.dump
- Homepage: https://github.com/olavoasantos/pretty.dump#readme
- Issues: https://github.com/olavoasantos/pretty.dump/issues
- npm.io page: https://npm.io/package/pretty.dump

## Dependencies (1)

- [console.echo](https://npm.io/package/console.echo.md) 0.0.3

## Recent versions

- 0.0.1 (latest) — 2017-08-29

## README

# Pretty Dump
Provides a better dump function to visualize data in the terminal.

## TOC

+ [Installation](#installation)
+ [Basic Usage](#basic-usage)
+ [Examples](#examples)
    * [String](#string)
    * [Number](#number)
    * [Boolean](#boolean)
    * [Null](#null)
    * [Undefined](#undefined)
    * [Array](#array)
    * [Object](#object)
    * [Function](#function)
    * [Class](#class)
+ [Methods](#methods)
    * [dump()](#dump)
    * [dd()](#dd)
+ [Author](#author)

## Installation

```
    npm install pretty.dump
```

## Basic Usage

```js
    let pretty = require("pretty.dump");
    
    let variable = "string";

    pretty.dump(variable); // ==> "string"
```

## Examples

#### String

```js
    let variable = "string";

    pretty.dump(variable);
```

![string screenshot](/docs/string.jpg?raw=true "string screenshot")

#### Number

```js
    let variable = 123;

    pretty.dump(variable);
```

![int screenshot](/docs/int.jpg?raw=true "int screenshot")

#### Boolean

```js
    let variable = true;

    pretty.dump(variable);
```

![bool screenshot](/docs/bool.jpg?raw=true "bool screenshot")

#### Null

```js
    let variable = null;

    pretty.dump(variable);
```

![null screenshot](/docs/null.jpg?raw=true "null screenshot")

#### Undefined

```js
    let variable = undefined;

    pretty.dump(variable);
```

![undefined screenshot](/docs/undefined.jpg?raw=true "undefined screenshot")

#### Array

```js
    let variable = ["a", "b", ["c", "d"]];

    pretty.dump(variable);
```

![array screenshot](/docs/array.jpg?raw=true "array screenshot")

#### Object

```js
    let variable = {
        name: "PrettyDump",
        status: "active"
    };

    pretty.dump(variable);
```

![object screenshot](/docs/object.jpg?raw=true "object screenshot")

#### Function

```js
    let variable = (a) => {
        return a*a;
    };

    pretty.dump(variable);
```

![function screenshot](/docs/function.jpg?raw=true "function screenshot")

#### Class

```js
    let variable = pretty;

    pretty.dump(variable);
```

![class screenshot](/docs/class.jpg?raw=true "class screenshot")

In case of circular relationships, PrettyDump will print `[Circular]`.

## Methods

### `dump()`

Prettyfies and dumps the variable to the console.

#### Example

```js
    let variable = false;

    pretty.dump(variable); // ==> false
```

### `dd()`

A.k.a. Die and dump. It prettyfies, dumps the variable to the console and exits the process.

#### Example

```js
    let variable = ["a", "b"];

    pretty.dump(variable); // ==> array:2 [ 0: "a" 1: "b"]
```

## Author
+ [Olavo Amorim Santos](https://github.com/olavoasantos)

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