proxy-keypath
v1.0.3
Published
create an object that trace the current keypath
Downloads
14
Readme
proxy-keypath
创建一个能追踪当前keypath的特殊对象
这样你就能实现一些有趣的api设计,例如
const keypath = require('proxy-keypath');
const fetch = require('node-fetch');
async function main() {
const www = keypath('https://www', {
async get() {
return fetch(`${this}`);
},
});
const resp = await www.google.com.get();
const text = await resp.text();
console.log(text);
}
main()