0.2.0 • Published 7 years ago

@eq8/framework v0.2.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 years ago

@eq8/framework

An opinionated application development framework

Requirement

  • NodeJS >= 6

Installation

npm install --save @eq8/framework

Example

const framework = require('@eq8/framework')();

framework.use(function plugin({ greetings }) {
	const services = this;

	services.add({ init: 'sample-plugin' }, ({ init }, done) => {
		console.log('Initializing:', init);
		done();
	});

	services.add({ plugin: 'sample', cmd: 'hello' }, ({ name }, done) => {
		console.log(`${greetings}! I am ${name}`);
		done(null, { name });
	});

	return {
		name: 'sample-plugin'
	};
}, {
	greetings: 'Hello World'
});

framework.ready(function onReady() {
	this.act({ plugin: 'sample', cmd: 'hello', name: 'anonymous' }, (err, args) => {
		console.log('err:', err);
		console.log('args:', args);
	});
});

Output:

info: initialized
Initializing: sample-plugin
Hello World! I am anonymous
err: null
args: { name: 'anonymous' }
0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.0

7 years ago