# mazehall

> Application framework with flexible module management and a streaming interface. Command line interface supported.

Latest version **2.1.0** (published 2015-07-24) · MIT license · 0 weekly downloads

## Install

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

Provides the commands `mazehall`, `mazehall-init`, `mazehall-module`, `mazehall-plugin`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2015-07-24 |
| First published | 2014-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Mazehall |
| Maintainers | jensklose |
| Keywords | mazehall, module, plugin, express, frp, reactive, stream |

## Links

- npm: https://www.npmjs.com/package/mazehall
- Repository: https://github.com/mazehall/mazehall
- Homepage: https://github.com/mazehall/mazehall#readme
- Issues: https://github.com/mazehall/mazehall/issues
- npm.io page: https://npm.io/package/mazehall

## Dependencies (2)

- [kefir](https://npm.io/package/kefir.md) ^2.7.1
- [commander](https://npm.io/package/commander.md) ^2.8.1

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2015-07-24
- 2.0.1 — 2015-07-15
- 2.0.0 — 2015-07-13
- 1.0.1 — 2015-07-12
- 1.0.0 — 2015-04-21
- 0.6.0 — 2015-03-19
- 0.5.0 — 2015-01-11
- 0.4.0 — 2015-01-11
- 0.3.1 — 2014-11-11
- 0.3.0 — 2014-11-04
- 0.2.1 — 2014-10-23
- 0.2.0 — 2014-10-12
- 0.1.1 — 2014-09-23
- 0.1.0 — 2014-09-23

## README

# Mazehall

Mazehall is a flexible module loader system. Build on top of the Reactive Programming library
[Kefir](https://pozadi.github.io/kefir/#).

An express interface is included. Stream all your routes into your app or configure a mask on startup.

## Installation

    $ [sudo] npm install --save mazehall


## Usage

### Manually case

Create your own new application with an testable app.js like:

    var mazehall = require('mazehall');
    var express = require('express');

    var app, server;
    app = express();
    server = require('http').Server(app);

    mazehall.moduleStream.log('module loader');
    mazehall.initExpress(app);

    module.exports = server;

and a startup file server.js like:

    var server = require('./app.js');

    var port;
    port = process.env.PORT || 3000
    server.listen(port, function() {
      console.log('server listen on port: ' + port);
    });


### Command line case

Let's do it mazehall cli.  

    $ [sudo] npm install mazehall -g

A global installation is an optional step. You could also call the cli interface in the node_modules/.bin directory.

    mkdir myapp
    cd myapp
    mazehall init

At this point you have an mazehall application with express integration. Now you need at least an application module.

    mazehall module gui

That's all.

    npm start

    server listen on port: 3000
    module loader <value> { module: 'gui', components: [ 'ui', '' ] }



## API

### Module loader interface

* `mazehall.moduleStream`
  * handle a module stream bus
  * could be used for logging and custom interfaces

* `mazehall.loadStream([options])`
  * starts the module loading stream

* `mazehall.initExpress(app [, options])`
  * starts the module enable stream and processing for express interface


### Module interface

By default Mazehall is looking for modules in the ```app_module/*``` directories.
Place a package.json file in the modules and add at least the ```mazehall: true``` key.
More complex scenarios uses the ```components: ['restapi','admin']``` array to handle the enabled
modules. See also the [mazehall-seed example app](https://github.com/mazehall/mazehall-seed).

An example package.json
```
    {
      "name": "moduleGui",
      "version": "0.1.0",
      "description": "User Interface",
      "main": "index.js",
      "mazehall": true,
      "components": ["ui"],
      "author": "Jens Klose",
      "license": "MIT"
    }
```


### Plugin interface

Plugins are first class Node/Io.js modules. They stay in the node_modules directory but don't
shipped in package.json. They are managed by mazehall and are by default not persisted.

You need your own application logic and infrastructure to build things like extensions-store or so on.

#### Usage

      mazehall-plugin [install|remove|update] [name]


### Environment variables

#### Component Id
```
    MAZEHALL_COMPONENTS = 'api,cloud'
```

- string to identify the kind of server process like 'jsonApi' or 'admin'
- 'core' processes load all modules
- non core like 'admin' loads only the admin modules from the core

## Run Tests

``` bash
  $ npm test
```

#### License: MIT
#### Author: [Mazehall]

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