The TypeScript Compiler Preview
Following the announcement of TypeScript, Microsoft has released the TypeScript 0.8 compiler preview, inviting web developers to validate its static type safety model.
Let's look at installing the compiler and type-checking JavaScript applications:
bashcode
# Installing the TypeScript compiler preview in 2012
npm install -g typescriptCompiling Typed Code
The compiler evaluates type safety rules and transpiles code down to standard clean JavaScript:
typescriptcode
// C# styled classes in TypeScript 0.8
class Logger {
log(message: string): void {
console.log("[LOG]: " + message);
}
}Running tsc file.ts outputs a clean JavaScript file playable on any browser, bringing static compilation safety to web development.
VP
Vijay Paliwal
Founder, SHIVAM ITCS · 18+ years enterprise & AI engineering
MCA · Ex-HiveGPT USA · Ex-Social27 Seattle