# winston-transport

> Base stream implementations for winston@3 and up.

Latest version **4.9.0** (published 2024-11-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install winston-transport
pnpm add winston-transport
yarn add winston-transport
bun add winston-transport
```

## Health

**Score 45/100 (D)** — status: stable.

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

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 4.9.0 |
| Published | 2024-11-10 |
| First published | 2015-11-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 12.0.0 |
| Dependencies | 3 |
| Unpacked size | 53.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 71 |
| Author | Charlie Robbins |
| Maintainers | jcrugzz, indexzero, dabh, w-b-t, maverick18722 |
| Keywords | winston, transport, winston3 |

## Links

- npm: https://www.npmjs.com/package/winston-transport
- Repository: https://github.com/winstonjs/winston-transport
- Homepage: https://github.com/winstonjs/winston-transport#readme
- Issues: https://github.com/winstonjs/winston-transport/issues
- npm.io page: https://npm.io/package/winston-transport

## Dependencies (3)

- [logform](https://npm.io/package/logform.md) ^2.7.0
- [triple-beam](https://npm.io/package/triple-beam.md) ^1.3.0
- [readable-stream](https://npm.io/package/readable-stream.md) ^3.6.2

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

- 4.9.0 (latest) — 2024-11-10
- 4.8.1 — 2024-11-10
- 4.8.0 — 2024-09-27
- 4.7.1 — 2024-07-10
- 4.7.0 — 2024-02-04
- 4.6.0 — 2023-10-13
- 4.5.0 — 2022-02-05
- 4.4.2 — 2022-01-10
- 4.4.1 — 2021-12-14
- 4.4.0 — 2020-06-21
- 4.3.0 — 2018-12-23
- 4.2.0 — 2018-06-12
- 4.1.0 — 2018-05-31
- 4.0.0 — 2018-05-24
- 3.2.1 — 2018-04-25
- … 9 more at https://npm.io/package/winston-transport/versions

## README

# winston-transport

The base `TransportStream` implementation for `winston >= 3`. Use these to
write ecosystem Transports for `winston`.

## Usage

``` js
const Transport = require('winston-transport');
const util = require('util');

//
// Inherit from `winston-transport` so you can take advantage
// of the base functionality and `.exceptions.handle()`.
//
module.exports = class CustomTransport extends Transport {
  constructor(opts) {
    super(opts);

    //
    // Consume any custom options here. e.g.:
    // - Connection information for databases
    // - Authentication information for APIs (e.g. loggly, papertrail,
    //   logentries, etc.).
    //
  }

  log(info, callback) {
    setImmediate(() => {
      this.emit('logged', info);
    });

    // Perform the writing to the remote service

    callback();
  }
};
```

## Tests

Tests are written with `mocha`, `nyc`, `assume`, and 
`abstract-winston-transport`. They can be run with `npm`:

``` bash
npm test
```

##### Author: [Charlie Robbins](https://github.com/indexzero)
##### LICENSE: MIT

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