Skip to content

Commit

Permalink
fix: drop multi-stream (#174)
Browse files Browse the repository at this point in the history
* fix: migrate to streamx

* fix: drop multi-stream

* chore: update dep

* chore: bump async iterator ver
  • Loading branch information
ThaUnknown authored Sep 2, 2022
1 parent aa8e829 commit 284f260
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ const corePath = require('path')
const { BlobReadStream } = require('fast-blob-stream')
const isFile = require('is-file')
const junk = require('junk')
const MultiStream = require('multistream')
const joinIterator = require('join-async-iterator')
const once = require('once')
const parallel = require('run-parallel')
const queueMicrotask = require('queue-microtask')
const sha1 = require('simple-sha1')
const { Transform, PassThrough } = require('streamx')
const { Transform, PassThrough, Readable } = require('streamx')

const getFiles = require('./get-files') // browser exclude

Expand Down Expand Up @@ -218,7 +218,7 @@ function getPieceList (files, pieceLength, estimatedTorrentLength, opts, cb) {
let pieceNum = 0
let ended = false

const multistream = new MultiStream(streams)
const multistream = Readable.from(joinIterator(streams))
const blockstream = new BlockStream(pieceLength, { zeroPadding: false })

multistream.on('error', onError)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"block-stream2": "^2.1.0",
"fast-blob-stream": "^1.1.1",
"is-file": "^1.0.0",
"join-async-iterator": "^1.1.1",
"junk": "^3.1.0",
"minimist": "^1.2.5",
"multistream": "^4.1.0",
"once": "^1.4.0",
"piece-length": "^2.0.1",
"queue-microtask": "^1.2.3",
Expand Down

0 comments on commit 284f260

Please sign in to comment.