@mongodb-model/tcp-controller

0.0.10 • Public • Published

DB Query

Standalone base module extending the NodeJs Transform API with few other functionalities added

Installation

$ yarn add @mongodb-model/http-controller 

or

$ npm i @mongodb-model/http-controller

Simple Usage Example

 const Base = require('@mongodb-model/http-controller');
 const base = new Base();
 base.apiGet();
 base.on('apiGet', data => console.log(data));
 base.on('apiGet-error', error => console.error(error));
 

or

 class MyWonderfulClass extends require('@mongodb-model/http-controller') {

    constructor(...arrayOfObjects) {

    super({ objectMode: true, encoding: "utf-8", autoDestroy: true });

    arrayOfObjects.forEach(option => {
        if(Object.keys(option).length > 0){
            Object.keys(option).forEach((key) => { if(!this[key]) this[key] = option[key];})
        }
    });

    this.autobind(MyWonderfulClass);
    this.autoinvoker(MyWonderfulClass);
    this.setMaxListeners(Infinity);
  }
 };
 

Package Sidebar

Install

npm i @mongodb-model/tcp-controller

Weekly Downloads

0

Version

0.0.10

License

MIT

Unpacked Size

58.4 kB

Total Files

11

Last publish

Collaborators

  • eweah
  • afrosintech