proxymise

Chainable Promise Proxy

Github星跟踪图

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

主要指标

概览
名称与所有者kozhevnikov/proxymise
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2018-07-13 00:26:52
推送于2022-10-05 08:24:32
最后一次提交2018-07-16 01:56:53
发布数3
最新版本名称v1.0.2 (发布于 2018-07-16 01:58:35)
第一版名称v1.0.0 (发布于 2018-07-13 21:51:51)
用户参与
星数555
关注者数10
派生数20
提交数28
已启用问题?
问题数7
打开的问题数4
拉请求数0
打开的拉请求数0
关闭的拉请求数2
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?