ts2dart
raw JSON → 0.9.11 verified Fri May 01 auth: no javascript deprecated
ts2dart is a TypeScript to Dart transpiler, primarily developed to translate Angular 2 from TypeScript to Dart for its Dart user base. Version 0.9.11 is the latest stable release. The project is no longer actively maintained; users are advised to migrate to alternative solutions. Key differentiator: it enables Angular 2 Dart usage by transpiling TS directly to Dart.
Common errors
error Error: Cannot find module 'ts2dart' ↓
cause Package not installed globally or locally.
fix
Run
npm install -g ts2dart for global CLI access. error bash: ts2dart: command not found ↓
cause Global installation missing or PATH not set.
fix
Ensure npm global binaries are in PATH:
export PATH=$(npm bin -g):$PATH or reinstall with npm i -g ts2dart. Warnings
deprecated ts2dart is no longer maintained. The Angular team has moved to other tools. Consider using dart2js or other transpilers. ↓
fix Migrate to currently supported TypeScript-to-Dart solutions or use Angular's Dart source directly.
Install
npm install ts2dart yarn add ts2dart pnpm add ts2dart Quickstart
// Install globally: npm i -g ts2dart
// Usage: ts2dart inputFile.ts
// Note: The package currently does not export any JavaScript API; only a CLI tool.
// This example shows CLI usage.
// $ ts2dart app.ts