{"action":"opened","issue":{"url":"https://api.github.com/repos/streamich/memfs/issues/25","repository_url":"https://api.github.com/repos/streamich/memfs","labels_url":"https://api.github.com/repos/streamich/memfs/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/streamich/memfs/issues/25/comments","events_url":"https://api.github.com/repos/streamich/memfs/issues/25/events","html_url":"https://github.com/streamich/memfs/issues/25","id":253635077,"number":25,"title":"Incompatible with graceful-fs","user":{"login":"sapegin","id":70067,"avatar_url":"https://avatars2.githubusercontent.com/u/70067?v=4","gravatar_id":"","url":"https://api.github.com/users/sapegin","html_url":"https://github.com/sapegin","followers_url":"https://api.github.com/users/sapegin/followers","following_url":"https://api.github.com/users/sapegin/following{/other_user}","gists_url":"https://api.github.com/users/sapegin/gists{/gist_id}","starred_url":"https://api.github.com/users/sapegin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sapegin/subscriptions","organizations_url":"https://api.github.com/users/sapegin/orgs","repos_url":"https://api.github.com/users/sapegin/repos","events_url":"https://api.github.com/users/sapegin/events{/privacy}","received_events_url":"https://api.github.com/users/sapegin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-29T12:14:32Z","updated_at":"2017-08-29T12:14:32Z","closed_at":null,"body":"I’m trying to make it work with [graceful-fs](https://github.com/isaacs/node-graceful-fs). And it tries to access `fs.ReadStream.prototype`:\r\n\r\nhttps://github.com/isaacs/node-graceful-fs/blob/65cf80d1fd3413b823c16c626c1e7c326452bee5/graceful-fs.js#L165-L166\r\n\r\nwhich doesn’t exist on memfs:\r\n\r\n```\r\n> const fs = require('fs');\r\nundefined\r\n> fs.ReadStream.prototype\r\nReadStream {\r\n  open: [Function],\r\n  _read: [Function],\r\n  _destroy: [Function],\r\n  close: [Function] }\r\n> const memfs = require('memfs');\r\nundefined\r\n> memfs.fs.ReadStream.prototype\r\nundefined\r\n```\r\n\r\nI can make it work by doing this change in `index.ts`:\r\n\r\n```diff\r\n-    fs.WriteStream = (volume as any).WriteStream.bind(null, vol);\r\n+    fs.WriteStream = (volume as any).WriteStream;\r\n-    fs.ReadStream = (volume as any).ReadStream.bind(null, vol);\r\n+    fs.ReadStream = (volume as any).ReadStream;\r\n```\r\n\r\nBut I assume it would break other things (though all tests are passing) otherwise you won’t do that."}}
{"actor":{"display_login":"sapegin"}}