# brout

> stdout and stderr for browsers

Latest version **1.3.0** (published 2019-10-09) · MIT license · 0 weekly downloads

## Install

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

## 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.0 |
| Published | 2019-10-09 |
| First published | 2014-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 1 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Maximilian Antoni |
| Maintainers | mantoni |
| Keywords | stdout, stderr, browser, browserify, browserify-transform |

## Links

- npm: https://www.npmjs.com/package/brout
- Repository: https://github.com/mantoni/brout.js
- Issues: https://github.com/mantoni/brout.js/issues
- npm.io page: https://npm.io/package/brout

## Dependencies (1)

- [through2](https://npm.io/package/through2.md) ^2.0.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2019-10-09
- 1.2.0 — 2016-10-28
- 1.1.1 — 2016-08-26
- 1.1.0 — 2016-01-19
- 1.0.2 — 2015-06-24
- 1.0.1 — 2014-11-27
- 1.0.0 — 2014-08-06
- 0.2.0 — 2014-04-09
- 0.1.5 — 2014-03-30
- 0.1.4 — 2014-03-13
- 0.1.3 — 2014-02-03
- 0.1.2 — 2014-01-26
- 0.1.1 — 2014-01-25
- 0.1.0 — 2014-01-23

## README

# stdout and stderr for browsers

Installs `process.stdout` and `process.stderr` and redirects `console` like
node.

Repository: <https://github.com/mantoni/brout.js>

---

## Install with npm

```
npm install brout
```

## Usage

Assume `my-script.js` contains this:

```js
process.stdout.write('Hello stdout!\n');
console.log('Hello %s!', 'console');
```

Use with [browserify][] and [phantomic][]:

```
$ browserify -t brout my-script.js | phantomic
Hello stdout!
Hello console!
```

## API

```js
var brout = require('brout');

brout.on('out', function (str)) {
  // ...
});

brout.on('err', function (str)) {
  // ...
});

brout.on('exit', function (code)) {
  // ...
});
```

Event listeners are tiggered by these calls:

- `process.stdout.write(string)`
- `process.stderr.write(string)`
- `process.exit(code)`

The console functions `log`, `info`, `warn` and `error` get replaced and the
original implementation is exposed:

- `console.log.original`
- `console.info.original`
- `console.warn.original`
- `console.error.original`

The console override behaves like node's implementation and writes to
`process.stdout` and `process.sterr`.

If an `out` or `err` listener is installed, then the corresponding console
message is no longer forwarded to the original console implementation.

## License

MIT

[browserify]: http://browserify.org
[phantomic]: https://github.com/mantoni/phantomic

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