by binarynate · 5y ago · 0 comments
- TypeScript works out-of-the-box without configuration
- includes modern browser APIs like fetch() without needing to import additional dependencies
- The Deno-specific APIs (like Deno.readTextFile()[0]) are Promise-based and have intuitive interfaces
- The Deno standard library[1] reduces the need for 3rd party dependencies, since it covers a lot of cases where one would be needed
I haven't yet used Deno in a commercial product, but I believe I will in the future because Deno seems ready for primetime. [0]https://doc.deno.land/builtin/stable#Deno.readTextFile
[1]https://deno.land/manual/standard_libraryFYI, Node has Promise-based APIs for all filesystem APIs. Node also supports ES modules that use top-level await.
If you create a file `test.mjs` and put this in it, it'll work:
import {readFile} from 'fs/promises';
console.log(await readFile('foo.txt', 'utf8'));
https://nodejs.org/api/fs.html#fs_filehandle_readfile_option...Deno goes in the wrong direction. It's a TS fanboy invention in search of a problem.
And I say that as a TypeScript fanboy.
Hardly. TS would have 1% of the adoption without JS.
> creator of Node, started Deno
Kudos for Dahl for his practical, very successful project Node.js.
I’m curious what you think is the right direction Deno should have taken.
require("fs").readFileSync("hello.txt").toString() // toString because it's a buffer by default