admin 管理员组文章数量: 1086019
I am looking to adopt NodeJS as a server language for a project. However, I am concerned with Javascript as a programming language and am also concerned the lack of type checking of Javascript.
Is there a way to introduce static typing in NodeJS? I have read about TypeScript. However, I am not sure how popular and well supported typeScript is.
For example, there are only 1400 questions on TypeScript on Stackoverflow.
Can anyone speak about TypeScript in production or any optional static typing for NodeJS?
I am looking to adopt NodeJS as a server language for a project. However, I am concerned with Javascript as a programming language and am also concerned the lack of type checking of Javascript.
Is there a way to introduce static typing in NodeJS? I have read about TypeScript. However, I am not sure how popular and well supported typeScript is.
For example, there are only 1400 questions on TypeScript on Stackoverflow.
Can anyone speak about TypeScript in production or any optional static typing for NodeJS?
Share Improve this question asked Oct 25, 2013 at 16:53 samolsamol 20.7k33 gold badges93 silver badges132 bronze badges 2- Dynamic typing is a strength of JavaScript. If you want static typing on your server-side code you should be using Java or C#. – Hector Correa Commented Oct 25, 2013 at 19:42
- 1 Or NodeJS with TypeScript :) – Fenton Commented Oct 25, 2013 at 22:24
2 Answers
Reset to default 6Yes, you can use TypeScript to create node applications. There are several related node type definitions to assist with this at https://github./borisyankov/DefinitelyTyped. These definitions are required for the tsc piler to understand what your node-specific code is trying to do. Depending on your TS editor, they can also be used to provide intellisense while editing.
Here's a recent article that discusses how prevalent TypeScript is these days: http://blogs.msdn./b/typescript/archive/2013/10/17/typescript-and-the-road-to-1-0.aspx
Is there a way to introduce static typing in NodeJS?
There's a Node module for Typescript, instructions on the "get it" page on the Typescript site:
npm install -g typescript
Then you pile your Typescript (.ts) files to JavaScript:
tsc helloworld.ts
本文标签: javascriptIs statically typed nodeJS possible ie TypeScriptStack Overflow
版权声明:本文标题:javascript - Is statically typed nodeJS possible? i.e. TypeScript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1743985559a2513793.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论