Awesome Open Source
Awesome Open Source

SActive Web

🚀 A dependency injection web framework for Node.js.

Build Status Build Status License NPM version NPM Download License


npm install sactive-web

Note that 3.x.x is not compatible with 2.x.x and below !!!


  • Dependency injection.
  • Router, grouping routes, based on koa-router.
  • Interceptors.
  • Based on Koa2.


const App = require('..');

const app = new App();
app.bindAny('name', 'pooky');

app.use(($ctx, $name, $next) => {
  $ctx.testname1 = $name;
  .get('/users/:name', ($ctx, $next, $name) => {
    $ctx.body = {'name': $, 'testname1': $ctx.testname1, 'testname2': $name};
  .get('/users/:name', ($name, $ctx, $next) => {
    $ctx.response.body = {'name': $, 'testname1': $ctx.testname1, 'testname2': $name};
  .get('/users/:name', ($ctx, $name, $next) => {
    $ctx.body = {'name': $, 'testname1': $ctx.testname1, 'testname2': $name};



Babel setup

If you're not using node v7.6+, you can refer koa installation.


sactive-web along with many of the libraries it's built with support the DEBUG environment variable from debug which provides simple conditional logging.

For example to see all sactive-web debugging information just pass DEBUG=active:* and upon boot you'll see the list of middleware used, among other things.

  active:di bind class: injector, singleton: true +0ms
  active:di bind any: age, singleton: true +1ms
  active:application use - +0ms
  active:application use - +0ms
  active:application register get /users/:name +1ms
  active:application register get /users/ +0ms
  active:application use - +0ms
  active:di bind any: address, singleton: true +3ms
  active:di bind function: getAddress, singleton: true +1ms
  active:application listen +1ms


Install the dependencies, then run npm test:

npm install
npm test

# coverage
npm run test:cov


  • Benchmark test

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Javascript (1,538,296
Dependency Injection (1,821
Koa (1,216
Koa2 (929
Web Framework (758
Related Projects