# beano

> A Pino inspired logger for the browser.

Latest version **0.2.2** (published 2020-05-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install beano
pnpm add beano
yarn add beano
bun add beano
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2020-05-19 |
| First published | 2020-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 34.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Ethan Hathaway |
| Maintainers | erhathaway |
| Keywords | logger, browser, pino, childLogger, child logger, module, scoped, group, console.log, console |

## Links

- npm: https://www.npmjs.com/package/beano
- Repository: https://github.com/erhathaway/beano
- Homepage: https://github.com/erhathaway/beano#readme
- Issues: https://github.com/erhathaway/beano/issues
- npm.io page: https://npm.io/package/beano

## 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

- 0.2.2 (latest) — 2020-05-19
- 0.2.1 — 2020-05-19
- 0.2.0 — 2020-05-19
- 0.1.0 — 2020-05-18

## README

# Beano

[![bundlephobia size](https://badgen.net/bundlephobia/minzip/beano)](https://bundlephobia.com/result?p=beano)


A [Pino](https://github.com/pinojs/pino) inspired logger for the Browser.

## Usage

```typescript
import logger from 'beano';

// start logging with no initialization
// pass a message string or mergeObject as the first param
// if a mergeObject is the first param, you can pass the message string as the second param
logger.info({groupByMessage: true}, 'look at me!');

// create chilren from a logger
const childLogger = logger.child('my_module');

// pass a message string or merge object as the first param (like before!)
childLogger.info({muyBeano: true}, 'is right');
childLogger.debug('something doesnt seem right...');

// create a child logger from a child logger
const evenMoreChildrenLogger = childLogger.child({collapse: true}, 'my_sub_module');

// use debug, info, warn, error level
evenMoreChildrenLogger.warn('im a nested logger');

logger.info('starting over');
eventMoreChildrenLogger.error('or not');
```

The browser terminal output would look like:

```bash
> look at me
my_module
    > is right {muyBeano: true}
    > something doesnt seem right...
    my_sub_module
        > im a nested logger
> starting over
my_module
    my_sub_module
        > or not
```

## API

You can customize behavior by passing options to the merge object at any time!

Options:

| name           | type    | purpose                                                                                 |
| -------------- | ------- | --------------------------------------------------------------------------------------- |
| collapse       | boolean | Whether to use `console.group` or `console.groupCollapsed` for the current child scope. |
| groupByMessage | boolean | Whether to try and group sequential messages into the same group if they belong.        |

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