diff --git a/README.md b/README.md index c9413fe6..6226037a 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,17 @@ -# @thaunknown/simple-peer [![coveralls][coveralls-image]][coveralls-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] - -[coveralls-image]: https://coveralls.io/repos/github/thaunknown/simple-peer/badge.svg?branch=master -[coveralls-url]: https://coveralls.io/github/thaunknown/simple-peer?branch=master -[npm-image]: https://img.shields.io/npm/v/@thaunknown/simple-peer.svg -[npm-url]: https://npmjs.org/package/@thaunknown/simple-peer -[downloads-image]: https://img.shields.io/npm/dm/@thaunknown/simple-peer.svg -[downloads-url]: https://npmjs.org/package/@thaunknown/simple-peer +# @workadventure/simple-peer [![coveralls][coveralls-image]][coveralls-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[coveralls-image]: https://coveralls.io/repos/github/workadventure/simple-peer/badge.svg?branch=master +[coveralls-url]: https://coveralls.io/github/workadventure/simple-peer?branch=master +[npm-image]: https://img.shields.io/npm/v/@workadventure/simple-peer.svg +[npm-url]: https://npmjs.org/package/@workadventure/simple-peer +[downloads-image]: https://img.shields.io/npm/dm/@workadventure/simple-peer.svg +[downloads-url]: https://npmjs.org/package/@workadventure/simple-peer [standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg [standard-url]: https://standardjs.com #### Simple WebRTC video, voice, and data channels -This package is a more up-to-date version of feross's simple-peer, rewritten 100% in Typescript. It uses `EventEmitter` and `Uint8Array` instead of node streams and buffers, making the module lighter and fully compatible with browser bundlers like Vite. It provides `@thaunknown/simple-peer/lite.js` which is the same peer implementation, but without MediaTrack and MediaStream handling, just pure Uint8/String data. - +This package is a more up-to-date version of feross's simple-peer, rewritten 100% in Typescript. It uses `EventEmitter` and `Uint8Array` instead of node streams and buffers, making the module lighter and fully compatible with browser bundlers like Vite. It provides `@workadventure/simple-peer/lite.ts` which is the same peer implementation, but without MediaTrack and MediaStream handling, just pure Uint8/String data. > **Breaking change:** This version no longer extends `Duplex` stream. The `pipe()` method is not available. Use `peer.on('data', ...)` and `peer.send()` / `peer.write()` instead. @@ -53,7 +52,20 @@ This package is used by [WebTorrent](https://webtorrent.io) and [many others](#w npm install @workadventure/simple-peer ``` -This package works in the browser with a bundler like Vite. +This package works with modern bundlers (Vite, Rollup, Webpack) and also directly in the browser via native ESM. +If you do not use a bundler, include it using a ` +``` + +Variants are available as separate entry points: + +- Lite: `@workadventure/simple-peer/lite` +- Full: `@workadventure/simple-peer/full` ## usage @@ -74,9 +86,10 @@ Let's create an html page that lets you manually connect two peers:
- -