browser.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. 'use strict'
  2. const CustomStream = require('../stream')
  3. const promises = require('../stream/promises')
  4. const originalDestroy = CustomStream.Readable.destroy
  5. module.exports = CustomStream.Readable
  6. // Explicit export naming is needed for ESM
  7. module.exports._uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer
  8. module.exports._isUint8Array = CustomStream._isUint8Array
  9. module.exports.isDisturbed = CustomStream.isDisturbed
  10. module.exports.isErrored = CustomStream.isErrored
  11. module.exports.isReadable = CustomStream.isReadable
  12. module.exports.Readable = CustomStream.Readable
  13. module.exports.Writable = CustomStream.Writable
  14. module.exports.Duplex = CustomStream.Duplex
  15. module.exports.Transform = CustomStream.Transform
  16. module.exports.PassThrough = CustomStream.PassThrough
  17. module.exports.addAbortSignal = CustomStream.addAbortSignal
  18. module.exports.finished = CustomStream.finished
  19. module.exports.destroy = CustomStream.destroy
  20. module.exports.destroy = originalDestroy
  21. module.exports.pipeline = CustomStream.pipeline
  22. module.exports.compose = CustomStream.compose
  23. Object.defineProperty(CustomStream, 'promises', {
  24. configurable: true,
  25. enumerable: true,
  26. get() {
  27. return promises
  28. }
  29. })
  30. module.exports.Stream = CustomStream.Stream
  31. // Allow default importing
  32. module.exports.default = module.exports