Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Lightweight application extensibility and composition with a twist of feature reflection.
tag: v0.1.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
LICENSE
README.md
package.json

README.md

broadway

Lightweight application extensibility and composition with a twist of feature reflection.

Example

var broadway = require('broadway');

var app = new broadway.App();

// Attach some plugin to app
app.use(require('./plugins').);

app.init(function (err) {
});

Motivation

Lorem ipsum

API

App#init(callback)

Initialize application and it's plugins, callback will be called with null or initialization error as first argument.

App#use(plugin, options)

Attach plugin to application. plugin should conform to following interface:

var plugin = {
  "name": "example-plugin", // Plugin's name

  "attach": function attach(options) {
    // Called with plugin options once plugin attached to application
    // `this` - is a reference to application
  },

  "detach": function detach() {
    // Called when plugin detached from application
    // (Only if plugin with same name was attached)
    // `this` - is a reference to application
  }

  "init": function init(callback) {
    // Called on application initialization
    // App#init(callback) will be called once every plugin will call `callback`
    // `this` - is a reference to application
  }
};

App#on(event, callback) and App#emit(event, data)

See EventEmitter2 documentation for more information.

Installation

Installing npm (node package manager)

  $ curl http://npmjs.org/install.sh | sh

Installing broadway

  $ [sudo] npm install broadway

Tests

All tests are written with vows and should be run with npm:

  $ npm test

Charlie Robbins

License: MIT

Something went wrong with that request. Please try again.