Have ideas to improve npm?Join in the discussion! »

simple-tcp-server

1.0.0 • Public • Published

Simple TCP Build Status

A simple TCP server using koa styles and syntax with ES6 generators.

Installation

npm i --save simple-tcp-server

Example

var TCP = require('simple-tcp-server');
var app = new TCP();
 
app.use(function *(next) {
  this.state.user = yield db.getUser();
  yield next;
});
 
app.use(function *() {
  this.body = this.state.user;
});
 
var server = app.listen(1337);
 
server.on('error', function(err) {
  console.error(err);
});

Related

License

Released under the MIT License.

Install

npm i simple-tcp-server

DownloadsWeekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • avatar