ts-blank-space is a fast type-stripping compiler that converts TypeScript to JavaScript. It supports a modern subset of TypeScript by erasing the types and replacing them with whitespace. That's it. It is not a type checker and does not perform any other code transformations. The underlying technique can improve build performance and simplify development. The implementation is pure TypeScript. It is simple enough to read and understand in a few minutes because it is only 700 lines of code and reuses the original TypeScript parser. The core idea is to use spaces as a substitute for type annotations. You can think of ts-blank-space as a reference implementation of this type-stripping technique. Much like other compiler techniques seen in the JavaScript ecosystem, such as tree-shaking, it is a reusable idea that any TypeScript compiler could implement.

Features

  • Only 4 times slower than a native multi-threaded transformer
  • Fastest compared to non-native (JavaScript or Wasm)
  • No new JavaScript code is generated; instead, it re-uses slices of the existing source string
  • Less than 700 lines of code and one dependency (TypeScript)
  • Try it out in the playground
  • Documentation available

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

Apache License V2.0

Follow ts-blank-space

ts-blank-space Web Site

Other Useful Business Software
Zenflow- The AI Workflow Engine for Software Devs Icon
Zenflow- The AI Workflow Engine for Software Devs

Parallel agents. Multi-agent orchestration. Specs that turn into shipped code. Zenflow automates planning, coding, testing, and verification.

Zenflow is the AI workflow engine built for real teams. Parallel agents plan, code, test, and verify in one workflow. With spec-driven development and deep context, Zenflow turns requirements into production-ready output so teams ship faster and stay in flow.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of ts-blank-space!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript Libraries

Registered

2024-09-20