Proxymise

proxymise

Chainable Promise Proxy.

proxymise makes cheeky use of Proxy API and provides a high dose of syntax sugar in chaining promises.

Get it: npm install proxymise

Sample usage:

1
const proxymise = require('proxymise');
1
2
3
4
5
// Instead of thens
foo.then(value => value.bar())
  .then(value => value.baz())
  .then(value => value.qux)
  .then(value => console.log(value));
1
2
3
4
5
6
// Instead of awaits
const value1 = await foo;
const value2 = await value1.bar();
const value3 = await value2.baz();
const value4 = await value3.qux;
console.log(value4);
1
2
3
// Use proxymise
const value = await proxymise(foo).bar().baz().qux;
console.log(value);

GIF FTW

proxymise

Suggest a module

Comments