Nectar of the Programming Masses

    promise-domain-monkeypatch

    1.0.0 • Public • Published

    promise-domain-monkeypatch

    Don't break domain usage in an es6 Promise chain

    This issue sheds a bit more detail, but basically the ES6 promise implementation in Node doesn't carry through the domain context (if there is one).

    This is a module to monkeypatch to fix this.

    More are examples are in the tests.

    Useage

    require('promise-domain-monkeypatch');

    This will apply the patch.

    You can unpatch by doing the following:

    let PromisePatcher = require('promise-domain-monkeypatch');
    PromisePatcher.unpatch();

    Not applying the patch immediately

    let PromisePatcher = require('promise-domain-monkeypatch/patcher');
     
    ...some code...
     
    PromisePatcher.patch();
     
    ...some code...
     
    PromisePatcher.unpatch();

    Tests

    mocha --recursive  

    Keywords

    none

    Install

    npm i promise-domain-monkeypatch

    DownloadsWeekly Downloads

    286

    Version

    1.0.0

    License

    none

    Last publish

    Collaborators

    • landtech