0.1.5 • Published 9 years ago

plexi v0.1.5

Weekly downloads
5
License
MIT
Repository
github
Last release
9 years ago

plexi

NPM Version NPM Downloads Build Status Gratipay

Plexi is a plugin system for nodejs. Helps to make a horizontal plugin architecture.

Getting Started

Installation
$ sudo npm install plexi -g
Initialize project
# init with default activator js file (activator.js file will be created)
$ plexi init

# or your own activator js file can be specified
$ plexi init src/youractivator.js
Install plugins
# if you want install according to package.json/plexi.dependencies
$ plexi install

# install plexi based packages you want (--save option for save package.json/plexi.dependencies)
$ plexi install plexi.workbench --save
$ plexi install plexi.mongodb@^2.6.5 --save

# also can install from git repository
$ plexi install https://github.com/attrs/plexi.mongodb --save
$ plexi install attrs/plexi.mongodb --save

# uninstall
$ plexi uninstall plexi.workbench --save

# also can install from file system for local test (by symbolic link)
# (useful method for developing several plugins)
$ plexi link file:package_dir_path --save

# unlink
$ plexi unlink file:package_dir_path --save
Writing activator

See https://github.com/attrs/plexi/tree/master/examples

module.exports = {
	start: function(ctx) {		
		// preference from plexi.json
		var options = ctx.preference;
		
		// simple example for use plexi.http
		var http = ctx.require('plexi.http');
		var bucket = http.create().mount('/myapp');
		bucket.get('/index.html', function(req, res) {
			res.write('Hello, World!\n' + JSON.stringify(options));
		});
		
		console.log('[' + ctx.id + '] start');
	},
	stop: function(ctx) {
		console.log('[' + ctx.id + '] stop');
	}
};
Start plugin-system
# will be executed activator.js specified from plexi init (pakage.json/plexi.activator)
$ plexi start
...
plexi$ _
Internal cli usage
# plugin system status
plexi$ p
...
 
# plugins status
plexi$ ss
0     started      yourpacakage        0.0.1
1     started      plexi.http          0.1.0 
...

# plugin info ("0" is ss index number)
plexi$ p 0

# stop plugin
plexi$ stop 0

# start plugin
plexi$ start 0

# help
plexi$ h

# quit
plexi$ q

License

MIT

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.1.0-alpha.11

9 years ago

0.1.0-alpha.10

9 years ago

0.1.0-alpha.9

9 years ago

0.1.0-alpha.8

9 years ago

0.1.0-alpha7

9 years ago

0.1.0-alpha6

9 years ago

0.1.0-alpha5

9 years ago

0.1.0-alpha4

9 years ago

0.1.0-c

9 years ago

0.1.0-b

9 years ago

0.1.0-a

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1-a

10 years ago

0.0.1

10 years ago