Launch Week Day 3: Introducing Organization Notifications in Socket.Learn More
Socket
Book a DemoSign in
Socket

base-reporter

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base-reporter

Base application plugin for gathering information about files and reporting the results using custom reporters.

Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

base-reporter NPM version NPM downloads Build Status

Base application plugin for gathering information about files and reporting the results using custom reporters.

Install

Install with npm:

$ npm install base-reporter --save

Usage

var reporter = require('base-reporter');

API

reporter

Exposes smart plugin for adding a reporter instance to a base application.

Params

  • config {Object}: Configuration object.
  • returns {Function}: Plugin function to use with app.use

Example

app.use(reporter());

.reporter.captureFiles

Capture file paths going through a middleware.

  • returns {Function}: Function that can be used as a middleware function.

Example

app.preWrite(/./, app.reporter.captureFiles());

.reporter.add

Add a reporter function to the reporter with the given name.

Params

  • name {String}: Name of the reporter
  • reporter {Function}: Function to run when this reporter is used.
  • returns {Object} this: to enable chaining

Example

app.reporter.add('basic', function() {
  console.log(this.files);
});

.reporter.report

Run a registered reporter function.

Params

  • name {String}: Name of the report to run.
  • returns {Object} this: to enable chaining

Example

app.reporter.report('basic');
//=> file1.js,file2.js,file3.js

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

Generate readme and API documentation with verb:

$ npm install verb && npm run docs

Or, if verb is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Brian Woodward

License

Copyright © 2016, Brian Woodward. Released under the MIT license.

This file was generated by verb, v0.9.0, on June 14, 2016.

Keywords

app

FAQs

Package last updated on 14 Jun 2016

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