News for hackers. Stuff that matters.
Re:Deno on MDN by timdaub on Monday August 23, 2021 @11:53AM (#28277771)
> - The Deno-specific APIs (like Deno.readTextFile()[0]) are Promise-based and have intuitive interfaces

require("fs").readFileSync("hello.txt").toString() // toString because it's a buffer by default

Re:Deno on MDN by yberreby on Monday August 23, 2021 @12:29PM (#28278349)
A Promise-based API doesn't block the event loop, but a synchronous one like fs.readFileSync does. Their usage might look similar but their semantics differ vastly.
Re:Deno on MDN by timdaub on Monday August 23, 2021 @01:16PM (#28279024)
Fair enough. OP was talking about intuitive non-blocking APIs and I just considered "intuitive".