# plexi

> plugin system

Latest version **0.1.5** (published 2015-04-14) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install plexi
pnpm add plexi
yarn add plexi
bun add plexi
```

Provides the commands `px`, `plexi`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2015-04-14 |
| First published | 2014-10-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | joje |
| Maintainers | attrs, joje |
| Keywords | plexi, plugin, plugins, module, bundle, attrs, osgi |

## Links

- npm: https://www.npmjs.com/package/plexi
- Repository: https://github.com/attrs/plexi
- Issues: https://github.com/attrs/plexi/issues
- npm.io page: https://npm.io/package/plexi

## Dependencies (9)

- [npm](https://npm.io/package/npm.md) ^2.5.1
- [async](https://npm.io/package/async.md) ^0.9.0
- [chalk](https://npm.io/package/chalk.md) ^0.5.1
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.0
- [semver](https://npm.io/package/semver.md) ^4.1.0
- [wrench](https://npm.io/package/wrench.md) ^1.5.8
- [inquirer](https://npm.io/package/inquirer.md) ^0.8.2
- [cli-table](https://npm.io/package/cli-table.md) ^0.3.1
- [attrs.util](https://npm.io/package/attrs.util.md) ^0.1.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.1.5 (latest) — 2015-04-14
- 0.1.4 — 2015-02-25
- 0.1.3 — 2015-02-21
- 0.1.2 — 2015-02-12
- 0.1.1 — 2015-02-11
- 0.1.0 — 2015-02-09
- 0.1.0-alpha.11 — 2014-12-05
- 0.1.0-alpha.10 — 2014-12-05
- 0.1.0-alpha.9 — 2014-12-04
- 0.1.0-alpha.8 — 2014-12-04
- 0.1.0-alpha7 — 2014-12-01
- 0.1.0-alpha6 — 2014-11-27
- 0.1.0-alpha5 — 2014-11-27
- 0.1.0-alpha4 — 2014-11-27
- 0.1.0-c — 2014-11-27
- … 8 more at https://npm.io/package/plexi/versions

## README

# plexi

[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Build Status][travis-image-flat]][travis-url]
[![Gratipay][gratipay-image]][gratipay-url]

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

### Getting Started
##### Installation
```sh
$ sudo npm install plexi -g
```

##### Initialize project
```sh
# 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
```sh
# 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

```js
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
```sh
# will be executed activator.js specified from plexi init (pakage.json/plexi.activator)
$ plexi start
...
plexi$ _
```

##### Internal cli usage
```sh
# 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](LICENSE)
 


[npm-image]: https://img.shields.io/npm/v/plexi.svg?style=flat
[npm-url]: https://npmjs.org/package/plexi
[downloads-image]: https://img.shields.io/npm/dm/plexi.svg?style=flat
[downloads-url]: https://npmjs.org/package/plexi
[travis-image-flat]: https://img.shields.io/travis/attrs/plexi.svg?style=flat
[travis-image]: https://travis-ci.org/attrs/plexi.svg?branch=master
[travis-url]: https://travis-ci.org/attrs/plexi
[gratipay-image]: https://img.shields.io/gratipay/teamattrs.svg?style=flat
[gratipay-url]: https://gratipay.com/teamattrs/

---
_Source: https://npm.io/package/plexi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
