Replies: 2 comments 5 replies
-
That's a fair assessment. I initially started out by copying methods from the |
Beta Was this translation helpful? Give feedback.
3 replies
-
The new |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I liked your blog post, but one thing caught my eye:
fsx.arrayBuffer(filePath)
.ArrayBuffer is almost never what you want because you can't read from one directly. You have to create a view like a Uint8Array to actually read it. And lots of methods don't accept an ArrayBuffer, only a Uint8Array or Buffer wrapper.
That seems counter to the ethos of "Common cases should be easy". The common case for reading bytes wants a Uint8Array, not an ArrayBuffer.
And of course if you do need an ArrayBuffer for some reason (though this is extremely rare) you can do
bytes().buffer
and get it.Beta Was this translation helpful? Give feedback.
All reactions