🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

winston-transport

Package Overview
Dependencies
Maintainers
5
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

winston-transport

Base stream implementations for winston@3 and up.

latest
Source
npmnpm
Version
4.9.0
Version published
Weekly downloads
21M
1.7%
Maintainers
5
Weekly downloads
 
Created
Source

winston-transport

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

Usage

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:

npm test
Author: Charlie Robbins
LICENSE: MIT

Keywords

winston

FAQs

Package last updated on 10 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts