isomorphic-git / lightning-fs

A lean and fast 'fs' for the browser
MIT License
476 stars 47 forks source link

Clarify writeFile "data" Documentation #70

Open amxmln opened 3 years ago

amxmln commented 3 years ago

This is a minor thing, but since I just spent an embarrassingly long amount of time puzzling over it, I figured I’d mention it.

The documentation for fs.writeFile in the README mentions that "data should be a string of a Uint8Array."—which I interpreted as any data has to be converted into a Uint8Array and then encoded into a string. Looking through the source I noticed, however, that the function actually does the encoding for us if a string is passed.

Maybe this could be clarified? It might be just me, but the wording along with the amounts of time I have seen "or" misspelled as "of" really confused me here. :sweat_smile:

Either way, thank you so much for this library (and the rest of Isomorphic Git!).

Happy holidays, if you celebrate.