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 216 forks source link

more examples on how to use the api #278

Closed dsl400 closed 1 year ago

dsl400 commented 4 years ago

Some examples on how to do basic stuff like get a list of files and directories and perform actions like filter and sort mite help.

jcoutch commented 4 years ago

@dsl400 - BrowserFS emulates the NodeJS fs interface. As long as you've initialized your filesystems: https://jvilk.com/browserfs/2.0.0-beta/index.html

You can use a majority of the commands listed here: https://nodejs.org/api/fs.html

Also, there are a ton of examples online of how to use the NodeJS FileSystem API's. For some of the more basic commands, W3Schools has a good reference: https://www.w3schools.com/nodejs/nodejs_filesystem.asp

loic-meister-guild commented 3 years ago

@jcoutch: Sorry to say that your advice did not work for me, and the documentation really feels like an afterthought. Maybe I did not initialize the filesystem correctly, but existsSync() does not seem to work for files created during a previous session and saved with the IndexedDB ...

james-pre commented 1 year ago

@loic-meister-guild exists/existsSync were not implemented until recently with #334.

As for the question, jcoutch's advice should be applicable.