npm

Need private packages and team management tools?Check out npm Orgs. »

crowd-express

0.0.2 • Public • Published

crowd-express

Crowd for Express

Warning: this is very experimantal - in case you get it to work, you might feel "double rainbow all the way".

Usage

Ideally, one should be able to do so:

// Server
var Crowd = require('crowd')
var router = require('crowd-express')
 
function task (data) {
  // some calculations
  return result 
}
var crowd = new Crowd({x:1, y:2}, task)
  .on('data', function(data) {
    // data coming in real time
  })
  .on('end', function(results) {
    // task completed
  })
  .on('error', function(err) {
    // errors on the way
  })
 
var express = require('express')
var app = express()
var bodyParser = require('body-parser')
var port = process.env.PORT || 8080
app.use('/task', router(crowd))
 

The last line is the purpose of this library.

install

npm i crowd-express

Downloadsweekly downloads

12

version

0.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability