2 ms·
Do you know if Deno chose to use strings instead of buffers to be more consistent with the browser? I know buffers can be faster, but overall I like that readTe
by steve_adams_86 5y ago
Do you know if Deno chose to use strings instead of buffers to be more consistent with the browser? I know buffers can be faster, but overall I like that readTextFile is returning a string here. I suspect most use-cases ultimately want to handle the output as a string.
- deleted 5y ago[deleted]
- Keithamus 5y agoDeno uses uint8array (pretty much Nodes Buffers (Node Buffers subclass UInt8Array these days)) for almost all methods. For example Deno comes with `Deno.readFile` which returns a Promise<UInt8Array>, but they include the special case Deno.readTextFile because of how common it is to convert the contents to a string.
- steve_adams_86 5y agoAh of course, that seems obvious in retrospect. Thanks for clarifying it for me!
- deleted 5y ago[deleted]