New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

anchorman

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anchorman

reporter library

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

Anchorman

a reporter library

Motivation

I made this lib for SequelizeJS so they could easily hook up mocha reporters but it never happened. Dead small, dead simple and it works over events which is the way I considered best to be done. That's about the size of it.

Usage

// opts is an array of options
// that includes an eventemitter2 attribute
// for you to pass in ee2 params
var anchorman = require('anchorman')(opts);

// let's subscribe to some news
anchorman.on('someEvent', transports);

// now lets broadcast some news
anchorman.broadcast('someEvent', {some: 'data'});

// transports can be just a function
anchorman.on('someOtherEvent', function (data) {
  console.log(data);
});

// transports can be objects that implement a publish function
var transportObject = {
  someData: 'blabla',
  publish: function (data) {

  }
};

anchorman.on('someOtherEvent', transportObject);

// or they can be an array of transport objects
var transportsArray = [
  consoleTransport,
  fileTransport,
  emailTransport
];

anchorman.on('someEvent', transportsArray);

Keywords

reporter

FAQs

Package last updated on 21 Sep 2013

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