ts-blank-space is a type-stripper that removes TypeScript type annotations and converts TypeScript source code to JavaScript using the official TypeScript parser.
The tool solves the problem of stripping type syntax from TypeScript files while preserving executable JavaScript. It works by parsing TypeScript source code with the official TypeScript compiler API and then removing type annotations while keeping the original JavaScript slices intact, rather than regenerating code. This approach avoids the overhead of code generation and allows reuse of existing source string segments.
The tool suits projects that need fast, lightweight type stripping without external dependencies or native compilation. It works well for build pipelines, development tooling, and runtime environments where a pure JavaScript solution is preferred. The tool includes a Node.js loader for transparently processing imported TypeScript files and supports both CommonJS and ESM. The README notes that not all TypeScript syntax is supported and that no down-leveling of JavaScript occurs, so the output preserves the original JavaScript semantics.
Development activity shows consistent maintenance with regular updates addressing issues and improvements. The project maintains a small, focused codebase of around eight hundred lines with a single dependency on TypeScript itself, making it straightforward to understand and maintain. The team provides clear documentation including a playground for testing, performance benchmarks, and detailed guidance on unsupported syntax and configuration recommendations.