Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

This package has been deprecated

Author message:

this package has been deprecated

dambreaker

1.0.1 • Public • Published

DamBreaker

Streamify your web server.

stream.write({ word: "Dam" });
stream.end({ word: "Less" });

DamBreaker is the first NodeJS web server dedicated to streamify all responses.

npm install dambreaker --save

NPM Build Status Coverage Status NPM Download Dependencies Status

Features

* Structured your project using services.  * Dependency Injection to override default behavior.

Service.js

class Service {
};
 
text(context, stream, headers) {
 stream.write("Hello");
 stream.end("world")
};
 
json(context, stream, headers) {
  stream.write({ name: "peter" });
  stream.end({ name: "folk" });
};
 
exports = module.exports = Service;

Dependency Injection

Inject your service and define a new http route.

Override core services to custom DamBreaker.

{
  "services": [
    { "name": "service", "location": "./service"}
  ]
  "http-routes": [   
  ]
}

DamBreaker Configuration

{
    "services": "./services.json",
    "http": {
        "port": 3000
    }
}

Enjoy

Create a server.js

 
 
const DamBreaker = require("dambreaker");
const dambreaker = new Damless();
await dambreaker.start();

Run server on http://localhost:3000

Use other DamBreaker services to develop as fast as a rocket

You want to see some examples

To run our examples, clone the Qwebs repo and install the dependencies.

$ git clone https://github.com/BenoitClaveau/dambreaker --depth 1
cd dambreaker
$ npm install
cd exemples/helloworld
$ node server.js

Test

To run our tests, clone the Qwebs repo and install the dependencies.

$ git clone https://github.com/BenoitClaveau/dambreaker --depth 1
cd dambreaker
$ npm install
cd tests
$ node.exe "../node_modules/mocha/bin/mocha" .

Install

npm i dambreaker

DownloadsWeekly Downloads

9

Version

1.0.1

License

MIT

Unpacked Size

1.3 MB

Total Files

68

Last publish

Collaborators

  • avatar