Comparing version 5.0.2 to 5.0.3
@@ -19,4 +19,4 @@ /// <reference types="ws" /> | ||
} | ||
declare const _default: (socket: WebSocket, options?: DuplexWebSocketOptions | undefined) => DuplexWebSocket; | ||
declare const _default: (socket: WebSocket, options?: DuplexWebSocketOptions) => DuplexWebSocket; | ||
export default _default; | ||
//# sourceMappingURL=duplex.d.ts.map |
@@ -1,3 +0,3 @@ | ||
declare const _default: null; | ||
export default _default; | ||
import type { ServerOptions, WebSocketServer } from './server.js'; | ||
export declare function createServer(opts?: ServerOptions): WebSocketServer; | ||
//# sourceMappingURL=server.browser.d.ts.map |
@@ -1,2 +0,4 @@ | ||
export default null; | ||
export function createServer(opts) { | ||
throw new Error('WebSocket Servers cannot run in browsers'); | ||
} | ||
//# sourceMappingURL=server.browser.js.map |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { DuplexWebSocket } from './duplex.js'; | ||
@@ -3,0 +5,0 @@ import http from 'http'; |
{ | ||
"name": "it-ws", | ||
"version": "5.0.2", | ||
"version": "5.0.3", | ||
"description": "Simple async iterables for websocket client connections", | ||
@@ -52,11 +52,15 @@ "author": "Alan Shaw", | ||
".": { | ||
"types": "./dist/src/index.d.ts", | ||
"import": "./dist/src/index.js" | ||
}, | ||
"./client": { | ||
"types": "./dist/src/client.d.ts", | ||
"import": "./dist/src/client.js" | ||
}, | ||
"./duplex": { | ||
"types": "./dist/src/duplex.d.ts", | ||
"import": "./dist/src/duplex.js" | ||
}, | ||
"./server": { | ||
"types": "./dist/src/server.d.ts", | ||
"browser": "./dist/src/server.browser.js", | ||
@@ -66,5 +70,7 @@ "import": "./dist/src/server.js" | ||
"./sink": { | ||
"types": "./dist/src/sink.d.ts", | ||
"import": "./dist/src/sink.js" | ||
}, | ||
"./source": { | ||
"types": "./dist/src/source.d.ts", | ||
"import": "./dist/src/source.js" | ||
@@ -106,11 +112,11 @@ } | ||
{ | ||
"type": "chore", | ||
"type": "docs", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "docs", | ||
"type": "test", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "test", | ||
"type": "deps", | ||
"release": "patch" | ||
@@ -145,5 +151,9 @@ }, | ||
"type": "docs", | ||
"section": "Trivial Changes" | ||
"section": "Documentation" | ||
}, | ||
{ | ||
"type": "deps", | ||
"section": "Dependencies" | ||
}, | ||
{ | ||
"type": "test", | ||
@@ -179,3 +189,3 @@ "section": "Tests" | ||
"it-stream-types": "^1.0.2", | ||
"uint8arrays": "^3.0.0", | ||
"uint8arrays": "^4.0.2", | ||
"ws": "^8.4.0" | ||
@@ -195,3 +205,3 @@ }, | ||
"p-defer": "^4.0.0", | ||
"wherearewe": "^1.0.0", | ||
"wherearewe": "^2.0.1", | ||
"wsurl": "^1.0.0" | ||
@@ -198,0 +208,0 @@ }, |
@@ -1,13 +0,30 @@ | ||
# it-ws | ||
# it-ws <!-- omit in toc --> | ||
[![Build Status](https://github.com/alanshaw/it-ws/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/alanshaw/it-ws/actions/workflows/main.yml) | ||
[![dependencies Status](https://david-dm.org/alanshaw/it-ws/status.svg)](https://david-dm.org/alanshaw/it-ws) | ||
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) | ||
[![codecov](https://img.shields.io/codecov/c/github/alanshaw/it-ws.svg?style=flat-square)](https://codecov.io/gh/alanshaw/it-ws) | ||
[![CI](https://img.shields.io/github/workflow/status/alanshaw/it-ws/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/alanshaw/it-ws/actions/workflows/js-test-and-release.yml) | ||
> Use websockets via async iterables, both client and server | ||
> Simple async iterables for websocket client connections | ||
## Table of contents <!-- omit in toc --> | ||
- [Install](#install) | ||
- [Usage](#usage) | ||
- [Example - client](#example---client) | ||
- [Example - server](#example---server) | ||
- [API](#api) | ||
- [`import { connect } from 'it-ws/client'`](#import--connect--from-it-wsclient) | ||
- [`import { createServer } from 'it-ws/server'`](#import--createserver--from-it-wsserver) | ||
- [Example](#example) | ||
- [use with an http server](#use-with-an-http-server) | ||
- [core, websocket wrapping functions](#core-websocket-wrapping-functions) | ||
- [`import duplex from 'it-ws/duplex'`](#import-duplex-from-it-wsduplex) | ||
- [`import sink from 'it-ws/sink'`](#import-sink-from-it-wssink) | ||
- [`import source from 'it-ws/source'`](#import-source-from-it-wssource) | ||
- [License](#license) | ||
- [Contribute](#contribute) | ||
## Install | ||
```sh | ||
npm i it-ws | ||
```console | ||
$ npm i it-ws | ||
``` | ||
@@ -76,3 +93,3 @@ | ||
``` js | ||
```js | ||
import { createServer } from 'it-ws/server' | ||
@@ -101,3 +118,3 @@ import { connect } from 'it-ws/client' | ||
``` js | ||
```js | ||
try { | ||
@@ -143,3 +160,3 @@ await pipe( | ||
``` js | ||
```js | ||
import http from 'http' | ||
@@ -167,4 +184,3 @@ | ||
WebSockets do not support half open mode. | ||
[see allowHalfOpen option in net module]( | ||
http://nodejs.org/api/net.html#net_net_createserver_options_connectionlistener) | ||
[see allowHalfOpen option in net module](http://nodejs.org/api/net.html#net_net_createserver_options_connectionlistener) | ||
@@ -245,2 +261,9 @@ If you have a protocol that assumes halfOpen connections, but are using | ||
MIT | ||
Licensed under either of | ||
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>) | ||
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>) | ||
## Contribute | ||
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. |
@@ -0,2 +1,5 @@ | ||
import type { ServerOptions, WebSocketServer } from './server.js' | ||
export default null | ||
export function createServer (opts?: ServerOptions): WebSocketServer { | ||
throw new Error('WebSocket Servers cannot run in browsers') | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52143
697
265
+ Addedmultiformats@12.1.3(transitive)
+ Addeduint8arrays@4.0.10(transitive)
- Removedmultiformats@9.9.0(transitive)
- Removeduint8arrays@3.1.1(transitive)
Updateduint8arrays@^4.0.2