memfs icon indicating copy to clipboard operation
memfs copied to clipboard

Remove built-in dependencies

Open streamich opened this issue 2 years ago • 2 comments

Review and try to remove built-in Node.js module dependencies, so they are not bundled when building for web.

  • [ ] path
  • [ ] process
  • [ ] stream — is there a way to make the stream module optional?
    • [ ] Or maybe explicitly install readable-stream as required dependency.
  • [ ] buffer — create a thin wrapper around Uint8Array, when Buffer global is missing.
  • [ ] util
    • [ ] util.inherits()
  • [ ] Error messages
    • [ ] internal/errors.ts — Node-like errors vendored module
    • [ ] assert
      • [ ] assert.strictEqual()
      • [ ] assert()
    • [ ] url
      • [ ] url.URL
    • [ ] util
      • [ ] util.format()
      • [ ] util.inspect()

streamich avatar Jun 22 '23 09:06 streamich

Hey @streamich shouldn't this list include stream as well since memfs uses Readable, Writable?

abhishiv avatar Jul 10 '23 03:07 abhishiv

We will always need some stream implementation, due to fs.createReadStream() and fs.createWriteStream().

Maybe we could explicitly install readable-stream dependency, instead of relying on Node's built-in stream.

streamich avatar Jul 10 '23 09:07 streamich