DEV Community

Discussion on: Want to write backend in typescript.

Collapse
 
maniflames profile image
Maniflames

The author of nodejs is actually working an improved runtime that will allow you to use typescript on the back-end!

It's not done yet so you should use what rhymes has suggested but it might be interesting to check out:

denoland / deno

A new way to JavaScript

deno

Linux & Mac Windows

A new way to JavaScript.

  • Supports TypeScript out of the box. Uses a recent version of V8. That is, it's very modern JavaScript.

  • No package.json. No npm. Not explicitly compatible with Node.

  • Imports reference source code URLs only.

    import { test } from "https://unpkg.com/deno_testing@0.0.5/testing.ts"
    import { log } from "./util.ts";

    Remote code is fetched and cached on first execution, and never updated until the code is run with the --reload flag. (So, this will still work on an airplane. See ~/.deno/src for details on the cache.)

  • File system and network access can be controlled in order to run sandboxed code. Defaults to read-only file system access and no network access. Access between V8 (unprivileged) and Rust (privileged) is only done via serialized messages defined in this flatbuffer. This makes it easy to audit. To enable write access…

He also gave a talk on why he decided to build deno:

Collapse
 
rhymes profile image
rhymes

Interesting, he basically wrote a more secure version of Node with Rust and TypeScript :D

Collapse
 
maniflames profile image
Maniflames

Yes! I really hope it will take of as a strong alternative to nodejs