ws-promise:一个微小的、基于 Promise 的 WebSocket 协议,允许在 ECMAScript 中使用请求-响应-源码

上传者: 42131790 | 上传时间: 2021-07-24 16:03:53 | 文件大小: 160KB | 文件类型: ZIP
ws-promise 该项目使您能够在通过 WebSockets 通信时使用async和await 。 在幕后,WebSocket API 首先被包裹在一个Promise层中,然后不同的端点通过一个微小的 RPC 协议连接在一起。 总之,它使您能够在客户端编写这样的代码......: 客户端.mjs import Client from "ws-promise/Client" ; const client = new Client ( "ws://localhost:8000" ) ; ( async ( ) => { await client . open ( ) ; /* The client can now call all server (!) methods that you expose */ const six = await client . add (

文件下载

资源详情

[{"title":"( 24 个子文件 160KB ) ws-promise:一个微小的、基于 Promise 的 WebSocket 协议,允许在 ECMAScript 中使用请求-响应-源码","children":[{"title":"ws-promise-master","children":[{"title":".eslintrc <span style='color:#111;'> 5.21KB </span>","children":null,"spread":false},{"title":".github","children":[{"title":"workflows","children":[{"title":"master.yml <span style='color:#111;'> 264B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"src","children":[{"title":"RemoteError.mjs <span style='color:#111;'> 142B </span>","children":null,"spread":false},{"title":"codes.mjs <span style='color:#111;'> 33B </span>","children":null,"spread":false},{"title":"esm.mjs <span style='color:#111;'> 126B </span>","children":null,"spread":false},{"title":"Client.mjs <span style='color:#111;'> 3.34KB </span>","children":null,"spread":false},{"title":"index.mjs <span style='color:#111;'> 69B </span>","children":null,"spread":false},{"title":"Message.mjs <span style='color:#111;'> 1.25KB </span>","children":null,"spread":false},{"title":"addDefaults.mjs <span style='color:#111;'> 218B </span>","children":null,"spread":false},{"title":"Protocol.mjs <span style='color:#111;'> 1.71KB </span>","children":null,"spread":false},{"title":"proxify.mjs <span style='color:#111;'> 1.05KB </span>","children":null,"spread":false},{"title":"Instruction.mjs <span style='color:#111;'> 756B </span>","children":null,"spread":false},{"title":"Server.mjs <span style='color:#111;'> 2.29KB </span>","children":null,"spread":false}],"spread":false},{"title":".npmignore <span style='color:#111;'> 30B </span>","children":null,"spread":false},{"title":"examples","children":[{"title":"MathServer.mjs <span style='color:#111;'> 724B </span>","children":null,"spread":false}],"spread":true},{"title":"test","children":[{"title":"JSON.test.mjs <span style='color:#111;'> 103B </span>","children":null,"spread":false},{"title":"communicate.mjs <span style='color:#111;'> 11.03KB </span>","children":null,"spread":false},{"title":"Message.test.mjs <span style='color:#111;'> 681B </span>","children":null,"spread":false},{"title":"MessagePack.test.mjs <span style='color:#111;'> 155B </span>","children":null,"spread":false}],"spread":true},{"title":"README.md <span style='color:#111;'> 11.18KB </span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'> 47B </span>","children":null,"spread":false},{"title":".babelrc.js <span style='color:#111;'> 350B </span>","children":null,"spread":false},{"title":"package-lock.json <span style='color:#111;'> 623.49KB </span>","children":null,"spread":false},{"title":"package.json <span style='color:#111;'> 2.13KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明