综合编程

Why does TypeScript need Node.js?

微信扫一扫,分享到朋友圈

Why does TypeScript need Node.js?
0

This is probably not the best question but I’m still completely new to JS. I’m interested in Typescript (being an AS3 dev), but I keep reading that I need to instal node.js
to compile it? why is that?

Problem courtesy of: Phil

Solution

TypeScript is a language that compiles into JavaScript. The compiler that does this, appears to be written (or at least distributed) in JavaScript. And node.js
is the most common way to execute JavaScript outside a browser.

The typescript compiler is simply JavaScript, which is executed by node.js
to compile things.

Why is that, you ask? Well, because that’s what the developers of the compile chose to write their compiler in. It could have been any language they wanted really.

My hunch though, is that the compiler is actually written in TypeScript
, and they distribute the compiled version. Yeah, a compiler written in the language it’s supposed to compile, weird but possible, and beyond the scope of this question.

Solution courtesy of: Alex Wayne

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it’s original form on Stack Over Flow
.

阅读原文...


微信扫一扫,分享到朋友圈

Why does TypeScript need Node.js?
0

Node.js Recipes

Entering keys manually with Entity Framework

上一篇

服务的熔断机制 | 从0开始构建SpringCloud微服务(14)

下一篇

评论已经被关闭。

插入图片

热门分类

往期推荐

Why does TypeScript need Node.js?

长按储存图像,分享给朋友