isaacs / node-graceful-fs

fs with incremental backoff on EMFILE
ISC License
1.27k stars 148 forks source link

How to use it in a React app? #180

Closed hsluoyz closed 4 years ago

hsluoyz commented 4 years ago

Does this module support front-end JS like React? Or Node.js only?

Should I use global patching way? Patching where?

coreyfarrell commented 4 years ago

require('fs') / import fs from 'fs' are not available in the browser so I don't see how this could be supported there. I'd guess that you need to avoid it when targeting browsers or use some kind of build step to replace references to the graceful-fs module (and fs for that matter). Likely works fine from Electron / NW.js.