When you want to resolve/reject a promise from the outside
var InvertedPromise = require('inverted-promise')
var iP = new InvertedPromise()
var iP2 = new InvertedPromise()
iP.then((value) => {
console.log(value)
})
iP2.catch((err) => {
console.log(err)
})
iP.resolve('Hello')
iP2.reject('World')
Create a new InvertedPromise
Resolve the promise
Reject the promise
npm install inverted-promise