proxymise

Chainable Promise Proxy

Github stars Tracking Chart

Proxymise

npm

Chainable Promise Proxy.

Lightweight ES6 Proxy for Promises with no additional dependencies. Proxymise allows for method
and property chaining without need for intermediate then() or await for cleaner and simpler code.

Use

npm i proxymise
const proxymise = require('proxymise');

// Instead of thens
foo.then(value => value.bar())
  .then(value => value.baz())
  .then(value => value.qux)
  .then(value => console.log(value));

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

// Use proxymise
const value = await proxymise(foo).bar().baz().qux;
console.log(value);

Practical Examples

Performance

Proxymised benchmark with 10000 iterations is practically as performant as the non-proxymised one.

node test/benchmark.js 
with proxymise: 3907.582ms
without proxymise: 3762.375ms

Main metrics

Overview
Name With Ownerkozhevnikov/proxymise
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
Platform
License:MIT License
所有者活动
Created At2018-07-13 00:26:52
Pushed At2022-10-05 08:24:32
Last Commit At2018-07-16 01:56:53
Release Count3
Last Release Namev1.0.2 (Posted on 2018-07-16 01:58:35)
First Release Namev1.0.0 (Posted on 2018-07-13 21:51:51)
用户参与
Stargazers Count555
Watchers Count10
Fork Count20
Commits Count28
Has Issues Enabled
Issues Count7
Issue Open Count4
Pull Requests Count0
Pull Requests Open Count0
Pull Requests Close Count2
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private