jvilk / BrowserFS

BrowserFS is an in-browser filesystem that emulates the Node JS filesystem API and supports storing and retrieving files from various backends.
Other
3.06k stars 215 forks source link

Problems with Karma and unit tests, and Dynamic loading and garbage-collecting BrowserFS #262

Closed digable1 closed 1 year ago

digable1 commented 5 years ago

Hi - I have two "issues" - one or both could be a result of "I'm a newbie and I know it" and not a real issue.

First - This is a special use case:

  1. I want to load BrowserFS in order to load in configuration files
  2. After loading configuration files I want to release the module so garbage collection can reclain

In other words, after the initial loading of the configuration files, I never have further need of the file system.

Do I already get this behavior by releasing the local object I originally use for BrowserFS.install()? At first blush with a 2-minute scan of the core code, it looks like the answer is 'yes'. But I'm deferring to other's better understanding of the code due to my unfortunate lack of time.

If the answer to the above question is 'no', is this doable (without breaking the bank)?

Second:

I am having trouble getting BrowserFS loaded through Karma for unit-testing. I have the documented additions as specified for webpack as part of the webpack object in karma.config.js

It would greatly help if the documentation had a clear and simple example on how to use something like fs.readFileSync(...) in Javascript/Typescript when you're not using a Githubissues.

  • Githubissues is a development platform for aggregating issues.