diff options
Diffstat (limited to 'lib/webconn.js')
-rw-r--r-- | lib/webconn.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/webconn.js b/lib/webconn.js index b1170a6..046924e 100644 --- a/lib/webconn.js +++ b/lib/webconn.js @@ -1,12 +1,14 @@ -const { default: BitField } = require('bitfield') -const debugFactory = require('debug') -const get = require('simple-get') -const ltDontHave = require('lt_donthave') -const sha1 = require('simple-sha1') -const Wire = require('bittorrent-protocol') +import BitField from 'bitfield' +import debugFactory from 'debug' +import get from 'simple-get' +import ltDontHave from 'lt_donthave' +import sha1 from 'simple-sha1' +import Wire from 'bittorrent-protocol' + +import info from '../package.json' assert { type: 'json' } const debug = debugFactory('webtorrent:webconn') -const VERSION = require('../package.json').version +const VERSION = info.version const SOCKET_TIMEOUT = 60000 const RETRY_DELAY = 10000 @@ -16,7 +18,7 @@ const RETRY_DELAY = 10000 * @param {string} url web seed url * @param {Object} torrent */ -class WebConn extends Wire { +export default class WebConn extends Wire { constructor (url, torrent) { super() @@ -213,5 +215,3 @@ class WebConn extends Wire { this._torrent = null } } - -module.exports = WebConn |