Relative Content

Tag Archive for javascripttypescript

Choosing between CommonJS and ES modules

There are apparently two main approaches to structuring apps that use TypeScript, namely CommonJS modules and ES modules. Based on many lines in the manual, this is a critical factor in how you write things and particularly how you import and export things like type aliases and interfaces which I expect to use.

Typescript newbie needs help choosing between CommonJS modules and ES modules

There are apparently two main approaches to structuring apps that use Typescript, namely CommonJS modules and ES modules. Based on many many lines in the manual, this is a critical factor in how you write things and particularly how you import and export things like type aliases and interfaces which I expect to use.

Can I use ts files the exactly same way I use js files?

I’ve heard about TypeScript and I liked it, because I’ve always liked making annotations on my code. However, I would have to rename all my .js files to .ts files. I would like to add annotations to my functions with all TypeScript capabilities without renaming my files. But, as I learned later, that is not possible. So, my question is: Can I continue typing js code normally after renaming them to .ts extension?