Skip to content

A hapijs plugin for downloading and caching NodeSecurity advisory data.

Notifications You must be signed in to change notification settings

totherik/advisor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

advisor

A simple Hapi application/plugin for caching NodeSecurity Advisory data.

Run as a Plugin

var Hapi = require('hapi');
var advisor = require('advisor');

var server = new Hapi.Server();
server.connection({ port: 8000 });

server.register(
	{
		register: advisor,
	    options: {
	        /*interval: 50,
	        url: 'http://localhost:8000'*/
	    }
	},
	function (err) {
		if (err) { throw err; }

		server.start(function (err) {
			if (err) { throw err; }
            console.log('Server started at: ' + server.info.uri);
		});
	}
);

Run Standalone

$ npm i -g advisor
# ...
$ advisor
#...

Plugin API

createReadStream

Creates a readable stream that returns advisories as they're updated.

server.plugins.advisor.createReadStream().pipe(through.obj(advisories, _, done) {
	// ...
	done();
});

About

A hapijs plugin for downloading and caching NodeSecurity advisory data.

Resources

Stars

Watchers

Forks

Packages

No packages published