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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?