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

findhit-hotplug

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

findhit-hotplug

Hotplug is an universal plugin manager system for nodejs apps

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

Hotplug

Test Status Dependency Status

Hotplug is an universal plugin manager system for nodejs apps

Instalation

npm install findhit-hotplug --save

Usage / Implementation Example

App-side


	var Hotplug = require( 'findhit-hotplug' );

	Hotplug( 'MyAwesomeAppName' )
		.on( 'plug-in', function ( e ) {
			var plugin = e.plugin;

			// Some I/O over plugin ?
		})
		.on( 'plug-out', function ( e ) {
			var plugin = e.plugin;

			// Some I/O over plugin ?
		})
		.start({
			host: '127.0.0.1',
			port: '80',
			zip: '4490',
		});

Plugin-side


	var Hotplug = require( 'findhit-hotplug' ),
		app = Hotplug( 'MyAwesomeAppName' )
		plugin = Hotplug.Plugin( 'MyPlugin', 'SomeType' );

	plugin
		.on( 'starting', function () {
			// ...
		})
		.on( 'started', function () {
			// ...
		})
		.on( 'stoping', function () {
			// ...
		})
		.on( 'stopped', function () {
			// ...
		})
		.on( 'state-change', function ( e ) {
			// Everytime state changes
		});

	// Now we can introduce methods to plugin
	plugin.sync = function () {
		// Some I/O
	};

	plugin.teach = function () {
		// Some I/O
	};

	plugin.YOLO = function () {
		// Some I/O
	};

	// In the end, we just have to plug into app
	app.plug( plugin );

Available Classes

  • Hotplug.App - Event-driven Bus for each App.
  • Hotplug.Plugin - Event-driven for each Plugin which interacts with App.

How to access them?


	var Hotplug = require( 'findhit-hotplug' ),
		app, plugin;

	// Lets examplify App creation
	app = new Hotplug.App( 'MyAwesomeAppName' );

	// Initialize app
	app.start({ app: 'options', so: 'each', plugin: 'can', read: 'it' });

	// Now, Plugin creation
	plugin = new Hotplug.Plugin( 'PluginName', 'Type', { object: 'with', plugin: 'data' });

	// Linking plugin into app
	app.plug( plugin );

Keywords

pluggable

FAQs

Package last updated on 13 Oct 2014

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