File size: 416 Bytes
95f4e64
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
// this file needs to conditionally import a module, ESM doesn't support this synchronously
// we could avoid .cjs by using node:module but that doesn't sit well with preprocessors like typescript
// and bundlers which can bundle for node like webpack

module.exports = (() => {
  try {
    return require('utp-native')
  } catch (err) {
    console.warn('WebTorrent: uTP not supported', err)
    return {}
  }
})()