node package manager

m_jet

m_jet

Build Status

Full stack node js framework.

m_jet is a very minimal tool that exposes some other libraries namely:

Routes

Please refer to routes documentation for its capabilities...

routes on github.

Dataplex

Data is sent via dataplex and named multiplexed websocket streams, in the browser and server. Dataplex behaves like any other stream, allowing you to pipe to and pipe from it. Check out dataplex's documentation for more usage examples.

dataplex on github.

install

npm install m_jet --save

example

var jet = require('m_jet').server();
 
jet.router.addRoute('/json/api', function (req, res) {
    jet.json(res, { a: 'demo!' });
});
 
jet.router.addRoute('/', function (req, res) {
    jet.render_html(res, 'index.html');
});
 
jet.router.addRoute('/wildcard/:id?', function (req, res, j) {
    if (j.params.id === 'summin') {
        res.end('<h1>wildcard route</h1>');
    }
});
 
jet.socket(function (plex) {
    plex.add('/demo', function () {
        var d = new Readable;
        d.push('1');
        d.push('2');
        d.push('3');
        d.push(null);
        return d;
    });
});
 
jet.start();

on the client.

var jet = require('m_jet').client();
 
jet(function (plex) {
    
    let demo = plex.open('/demo');
    
    demo.on('data', function (data) {
        console.log(data);
    });
});

build with browserify...

browserify ./client.js -o public/bundle.js

include in the browser...

<script src="./bundle.js"></script>

todo

allow CORS (I middlewares / plugins / extendability?

contributions

All contributions or ideas welcome!

disclaimer

I am using this library for some personal mad science projects, your milage may vary!