Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/*! simple-peer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
const debug = require('debug')('simple-peer')
const getBrowserRTC = require('get-browser-rtc')
const randomstring = require('random-string')
const queueMicrotask = require('queue-microtask')
const EventEmitter = require('events')
const errCode = require('err-code')
import Debug from 'debug'
import getBrowserRTC from 'get-browser-rtc'
import randomstring from 'random-string'
import EventEmitter from 'events'
import errCode from 'err-code'

const debug = Debug('simple-peer')

const MAX_BUFFERED_AMOUNT = 64 * 1024
const ICECOMPLETE_TIMEOUT = 5 * 1000
Expand All @@ -24,7 +25,7 @@ function warn (message) {
* Duplex stream.
* @param {Object} opts
*/
class Peer extends EventEmitter {
export default class Peer extends EventEmitter {
constructor (opts) {
opts = Object.assign({
allowHalfOpen: false
Expand Down Expand Up @@ -1037,5 +1038,3 @@ Peer.config = {
}

Peer.channelConfig = {}

module.exports = Peer
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "tiny-simple-peer",
"description": "Simple one-to-one WebRTC video/voice and data channels, which drops stream support from simple-peer to improve performance and reduce bundle size",
"version": "10.0.0",
"type": "module",
"contributors": [
{
"name": "Feross Aboukhadijeh",
Expand All @@ -22,7 +23,6 @@
"err-code": "^3.0.1",
"events": "^3.3.0",
"get-browser-rtc": "^1.1.0",
"queue-microtask": "^1.2.3",
"random-string": "^0.2.0"
},
"devDependencies": {
Expand Down