Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

landtechnologies/promise-domain-monkeypatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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  

About

Don't break domain usage in an es6 Promise chain

Resources

Stars

Watchers

Forks

Packages

No packages published