{"_id":"isomorphic-ws","_rev":"3281964","name":"isomorphic-ws","description":"Isomorphic implementation of WebSocket","dist-tags":{"beta":"5.0.0-beta.3","latest":"5.0.0"},"maintainers":[{"name":"heineiuo","email":"heineiuo@gmail.com"}],"time":{"modified":"2024-05-16T05:31:46.000Z","created":"2017-04-28T08:03:01.196Z","5.0.0":"2022-06-27T10:47:56.680Z","5.0.0-beta.3":"2022-06-27T10:46:49.787Z","5.0.0-beta.2":"2022-06-27T10:44:57.922Z","5.0.0-beta.1":"2022-06-06T08:51:46.282Z","4.0.1":"2018-04-27T01:47:31.757Z","4.0.0":"2018-02-07T13:31:26.885Z","3.2.0":"2017-10-05T04:28:54.711Z","2.3.1":"2017-04-28T08:03:01.196Z"},"users":{},"author":{"name":"@heineiuo"},"repository":{"type":"git","url":"git+https://github.com/heineiuo/isomorphic-ws.git"},"versions":{"5.0.0":{"name":"isomorphic-ws","version":"5.0.0","description":"Isomorphic implementation of WebSocket","main":"node.js","types":"index.d.ts","browser":"browser.js","repository":{"type":"git","url":"git+https://github.com/heineiuo/isomorphic-ws.git"},"keywords":["browser","browsers","isomorphic","node","websocket","ws"],"author":{"name":"@heineiuo"},"license":"MIT","bugs":{"url":"https://github.com/heineiuo/isomorphic-ws/issues"},"homepage":"https://github.com/heineiuo/isomorphic-ws#readme","peerDependencies":{"ws":"*"},"gitHead":"b255b999fc63a94af561b09ea7e877c3da7051c2","_id":"isomorphic-ws@5.0.0","_nodeVersion":"18.4.0","_npmVersion":"8.12.1","dist":{"shasum":"e5529148912ecb9b451b46ed44d53dae1ce04bbf","size":2080,"noattachment":false,"key":"/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/isomorphic-ws/download/isomorphic-ws-5.0.0.tgz"},"_npmUser":{"name":"heineiuo","email":"heineiuo@gmail.com"},"directories":{},"maintainers":[{"name":"heineiuo","email":"heineiuo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/isomorphic-ws_5.0.0_1656326876526_0.8091918877190516"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-06-27T11:10:53.651Z","publish_time":1656326876680,"_cnpm_publish_time":1656326876680},"5.0.0-beta.3":{"name":"isomorphic-ws","version":"5.0.0-beta.3","description":"Isomorphic implementation of WebSocket","main":"node.js","types":"index.d.ts","browser":"browser.js","repository":{"type":"git","url":"git+https://github.com/heineiuo/isomorphic-ws.git"},"keywords":["browser","browsers","isomorphic","node","websocket","ws"],"author":{"name":"@heineiuo"},"license":"MIT","bugs":{"url":"https://github.com/heineiuo/isomorphic-ws/issues"},"homepage":"https://github.com/heineiuo/isomorphic-ws#readme","peerDependencies":{"ws":"*"},"readmeFilename":"README.md","gitHead":"b255b999fc63a94af561b09ea7e877c3da7051c2","_id":"isomorphic-ws@5.0.0-beta.3","_nodeVersion":"18.4.0","_npmVersion":"8.12.1","dist":{"shasum":"5149b620108e1d49623b1977978429e3d7223069","size":2088,"noattachment":false,"key":"/isomorphic-ws/-/isomorphic-ws-5.0.0-beta.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/isomorphic-ws/download/isomorphic-ws-5.0.0-beta.3.tgz"},"_npmUser":{"name":"heineiuo","email":"heineiuo@gmail.com"},"directories":{},"maintainers":[{"name":"heineiuo","email":"heineiuo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/isomorphic-ws_5.0.0-beta.3_1656326809596_0.6857441733299183"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-06-27T11:10:53.335Z","publish_time":1656326809787,"_cnpm_publish_time":1656326809787},"5.0.0-beta.2":{"name":"isomorphic-ws","version":"5.0.0-beta.2","description":"Isomorphic implementation of WebSocket","main":"node.js","types":"index.d.ts","browser":"browser.js","repository":{"type":"git","url":"git+https://github.com/heineiuo/isomorphic-ws.git"},"keywords":["browser","browsers","isomorphic","node","websocket","ws"],"author":{"name":"@heineiuo"},"license":"MIT","bugs":{"url":"https://github.com/heineiuo/isomorphic-ws/issues"},"homepage":"https://github.com/heineiuo/isomorphic-ws#readme","peerDependencies":{"ws":"*"},"gitHead":"b255b999fc63a94af561b09ea7e877c3da7051c2","_id":"isomorphic-ws@5.0.0-beta.2","_nodeVersion":"18.4.0","_npmVersion":"8.12.1","dist":{"shasum":"c899f1201c6c32e4d75ea02e8b6e1199fd14876a","size":2088,"noattachment":false,"key":"/isomorphic-ws/-/isomorphic-ws-5.0.0-beta.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/isomorphic-ws/download/isomorphic-ws-5.0.0-beta.2.tgz"},"_npmUser":{"name":"heineiuo","email":"heineiuo@gmail.com"},"directories":{},"maintainers":[{"name":"heineiuo","email":"heineiuo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/isomorphic-ws_5.0.0-beta.2_1656326697770_0.31470613288895577"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated","_cnpmcore_publish_time":"2022-06-27T11:10:52.977Z","publish_time":1656326697922,"_cnpm_publish_time":1656326697922},"5.0.0-beta.1":{"name":"isomorphic-ws","version":"5.0.0-beta.1","description":"Isomorphic implementation of WebSocket","main":"node.js","types":"index.d.ts","browser":"browser.js","repository":{"type":"git","url":"git+https://github.com/heineiuo/isomorphic-ws.git"},"keywords":["browser","browsers","isomorphic","node","websocket","ws"],"author":{"name":"@heineiuo"},"license":"MIT","bugs":{"url":"https://github.com/heineiuo/isomorphic-ws/issues"},"homepage":"https://github.com/heineiuo/isomorphic-ws#readme","peerDependencies":{"ws":"*"},"readmeFilename":"README.md","gitHead":"e7d264a562b5c9ad4a939a789c7ba43968f1ac38","_id":"isomorphic-ws@5.0.0-beta.1","_nodeVersion":"18.2.0","_npmVersion":"8.9.0","dist":{"shasum":"6c3d3f3f5b126911415cf68e218d07857e0e9183","size":2087,"noattachment":false,"key":"/isomorphic-ws/-/isomorphic-ws-5.0.0-beta.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/isomorphic-ws/download/isomorphic-ws-5.0.0-beta.1.tgz"},"_npmUser":{"name":"heineiuo","email":"heineiuo@gmail.com"},"directories":{},"maintainers":[{"name":"heineiuo","email":"heineiuo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/isomorphic-ws_5.0.0-beta.1_1654505506162_0.1358142496737882"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-06-06T09:09:33.143Z","publish_time":1654505506282,"_cnpm_publish_time":1654505506282},"4.0.1":{"name":"isomorphic-ws","version":"4.0.1","description":"Isomorphic implementation of WebSocket","main":"node.js","browser":"browser.js","repository":{"type":"git","url":"git+https://github.com/heineiuo/isomorphic-ws.git"},"keywords":["browser","browsers","isomorphic","node","websocket","ws"],"author":{"name":"@heineiuo"},"license":"MIT","bugs":{"url":"https://github.com/heineiuo/isomorphic-ws/issues"},"homepage":"https://github.com/heineiuo/isomorphic-ws#readme","peerDependencies":{"ws":"*"},"files":["index.d.ts","node.js","browser.js","README.md"],"gitHead":"99cf54389b9c70c4eb5f0ebdbc5fce9298b5c25f","_id":"isomorphic-ws@4.0.1","_npmVersion":"6.0.0","_nodeVersion":"9.2.0","_npmUser":{"name":"heineiuo","email":"heineiuo@gmail.com"},"dist":{"shasum":"55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc","size":2061,"noattachment":false,"key":"/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/isomorphic-ws/download/isomorphic-ws-4.0.1.tgz"},"maintainers":[{"name":"heineiuo","email":"heineiuo@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/isomorphic-ws_4.0.1_1524793651679_0.5101292044583203"},"_hasShrinkwrap":false,"publish_time":1524793651757,"_cnpm_publish_time":1524793651757},"4.0.0":{"name":"isomorphic-ws","version":"4.0.0","description":"Isomorphic implementation of WebSocket","main":"node.js","browser":"browser.js","repository":{"type":"git","url":"git+https://github.com/heineiuo/isomorphic-ws.git"},"keywords":["browser","browsers","isomorphic","node","websocket","ws"],"author":{"name":"@heineiuo"},"license":"MIT","bugs":{"url":"https://github.com/heineiuo/isomorphic-ws/issues"},"homepage":"https://github.com/heineiuo/isomorphic-ws#readme","peerDependencies":{"ws":"*"},"files":["node.js","browser.js","README.md"],"gitHead":"605be49fea91a3785d9bae8d976f7f20e684b0e2","_id":"isomorphic-ws@4.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.2.0","_npmUser":{"name":"heineiuo","email":"heineiuo@gmail.com"},"dist":{"shasum":"7b528b238c920eeb3f5fe429ac416df669ea4cba","size":902,"noattachment":false,"key":"/isomorphic-ws/-/isomorphic-ws-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/isomorphic-ws/download/isomorphic-ws-4.0.0.tgz"},"maintainers":[{"name":"heineiuo","email":"heineiuo@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/isomorphic-ws_4.0.0_1518010286830_0.13246476411067265"},"_hasShrinkwrap":false,"publish_time":1518010286885,"_cnpm_publish_time":1518010286885},"3.2.0":{"name":"isomorphic-ws","version":"3.2.0","description":"An isomorphic release of https://www.npmjs.com/package/ws","main":"node.js","browser":"browser.js","repository":{"type":"git","url":"git+https://github.com/heineiuo/isomorphic-ws.git"},"keywords":[],"author":{"name":"@heineiuo"},"license":"MIT","bugs":{"url":"https://github.com/heineiuo/isomorphic-ws/issues"},"homepage":"https://github.com/heineiuo/isomorphic-ws#readme","dependencies":{"ws":"3.2.0"},"files":["node.js","browser.js","README.md"],"gitHead":"d763495a996abc3cc3bd1325bda5b92dd2933b24","_id":"isomorphic-ws@3.2.0","_npmVersion":"5.4.2","_nodeVersion":"8.4.0","_npmUser":{"name":"heineiuo","email":"heineiuo@gmail.com"},"dist":{"shasum":"8d292b2b0551eed8df223a974a444fd18560d02a","size":542,"noattachment":false,"key":"/isomorphic-ws/-/isomorphic-ws-3.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/isomorphic-ws/download/isomorphic-ws-3.2.0.tgz"},"maintainers":[{"name":"heineiuo","email":"heineiuo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/isomorphic-ws-3.2.0.tgz_1507177734588_0.0820559523999691"},"directories":{},"publish_time":1507177734711,"_hasShrinkwrap":false,"_cnpm_publish_time":1507177734711},"2.3.1":{"name":"isomorphic-ws","version":"2.3.1","description":"isomorphic ws","license":"MIT","browser":"browser.js","main":"node.js","dependencies":{"ws":"^2.3.1"},"_id":"isomorphic-ws@2.3.1","scripts":{},"_shasum":"876a9a6f656b95e5671100f0c4f628b7617af135","_from":".","_npmVersion":"4.5.0","_nodeVersion":"7.0.0","_npmUser":{"name":"heineiuo","email":"heineiuo@gmail.com"},"dist":{"shasum":"876a9a6f656b95e5671100f0c4f628b7617af135","size":427,"noattachment":false,"key":"/isomorphic-ws/-/isomorphic-ws-2.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/isomorphic-ws/download/isomorphic-ws-2.3.1.tgz"},"maintainers":[{"name":"heineiuo","email":"heineiuo@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/isomorphic-ws-2.3.1.tgz_1493366579190_0.7316258219070733"},"directories":{},"publish_time":1493366581196,"_hasShrinkwrap":false,"_cnpm_publish_time":1493366581196}},"readme":"# isomorphic-ws\n\nIsomorphic implementation of WebSocket.\n\nIt uses:\n- [ws](https://github.com/websockets/ws) on Node\n- [global.WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) in browsers\n\n## Limitations\n\nBefore using this module you should know that\n[`ws`](https://github.com/websockets/ws/blob/master/doc/ws.md#class-websocket)\nis not perfectly API compatible with\n[WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket),\nyou should always test your code against both Node and browsers.\n\nSome major differences:\n\n- no `Server` implementation in browsers\n- no support for the constructor\n  [`options`](https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketaddress-protocols-options)\n  argument in browsers\n\n## Usage\n\nYou need to install both this package and [ws](https://github.com/websockets/ws):\n\n```\n> npm i isomorphic-ws ws\n```\n\nThen just require this package:\n\n```js\nconst WebSocket = require('isomorphic-ws');\n\nconst ws = new WebSocket('wss://echo.websocket.org/');\n\nws.onopen = function open() {\n  console.log('connected');\n  ws.send(Date.now());\n};\n\nws.onclose = function close() {\n  console.log('disconnected');\n};\n\nws.onmessage = function incoming(data) {\n  console.log(`Roundtrip time: ${Date.now() - data.data} ms`);\n\n  setTimeout(function timeout() {\n    ws.send(Date.now());\n  }, 500);\n};\n```\n\n## License\n\n[MIT](LICENSE)\n","_attachments":{},"homepage":"https://github.com/heineiuo/isomorphic-ws#readme","bugs":{"url":"https://github.com/heineiuo/isomorphic-ws/issues"},"license":"MIT"}