
Product
Introducing Custom Tabs for Org Alerts
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.
base-reporter
Advanced tools
Base application smart plugin for caching data and adding and running custom report functions.
Base application smart plugin for caching data and adding and running custom report functions.
Install with npm:
$ npm install base-reporter --save
var reporter = require('base-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.useExample
app.use(reporter());
Creates a middleware function that can be used with application middleware methods.
Params
fn {String|Function}: Pass a property string or function that will create a middleware function. Defaults to files.returns {Function}: Function that can be used as a middleware function.Example
// Default middleware will cache all files on the `reporter.files` array (can be accessed in report functions):
app.preWrite(/./, app.reporter.middleware());
// Pass a custom property string to cache files on another property:
app.preWrite(/./, app.reporter.middleware('templates'));
// Pass a custom function that creates the middleware function. The function will take the reporter instance:
app.preWrite(/./, app.reporter.middleware(function(reporter) {
var counter = 0;
return function(file, next) {
reporter.union('files', file);
reporter.set('counter', ++counter);
next():
};
}));
Add a report function to the reporter with the given name. Function may take the reporter instance and options as parameters.
Params
name {String}: Name of the reporterfn {Function}: report function to run when .reporter.report(name) is called.returns {Object} this: to enable chainingExample
app.reporter.add('basic', function(reporter, options) {
console.log(this.files);
});
Run a registered report function with the given options.
Params
name {String}: Name of the report to run.returns {Object} this: to enable chainingExample
app.reporter.report('basic', {foo: 'bar'});
//=> file1.js,file2.js,file3.js
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Generate readme and API documentation with verb:
$ npm install verb && npm run docs
Or, if verb is installed globally:
$ verb
Install dev dependencies:
$ npm install -d && npm test
Brian Woodward
Copyright © 2016, Brian Woodward. Released under the MIT license.
This file was generated by verb, v0.9.0, on June 16, 2016.
FAQs
Base application smart plugin for caching data and adding and running custom report functions.
We found that base-reporter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

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.

Product
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.