JSPM

@mongodb-model/http-controller

0.0.1000
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q24418F
  • License MIT

http-controller

Package Exports

  • @mongodb-model/http-controller
  • @mongodb-model/http-controller/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@mongodb-model/http-controller) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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);
  }
 };