BrowserFS icon indicating copy to clipboard operation
BrowserFS copied to clipboard

more examples on how to use the api

Open dsl400 opened this issue 6 years ago • 2 comments

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.

dsl400 avatar Aug 13 '19 10:08 dsl400

@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

jcoutch avatar Aug 16 '19 17:08 jcoutch

@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 ...

loic-meister-guild avatar Aug 03 '20 09:08 loic-meister-guild

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

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

james-pre avatar Mar 10 '23 00:03 james-pre