The nodejs-type-stripping repository provides an example of implementing a Node.js package with a TypeScript-based CLI command directly. The setup features a minimal dependency on Node.js types and focuses on specific TypeScript compiler options like 'allowImportingTsExtensions' and 'erasableSyntaxOnly' to facilitate a pure TypeScript environment. By retaining 'noEmit', the structure allows for type-checking without producing output files, while preserving the ability to transpile later, simplifying development and testing practices in a TypeScript context.
The repository demonstrates how to use TypeScript directly as a CLI without transpilation, employing unique compiler options for minimal TypeScript features.
Using the 'erasableSyntaxOnly' feature ensures compatibility by limiting TypeScript to syntax that can be stripped, preventing JSX or enums.
This package maintains 'noEmit' to avoid file emissions while allowing potential future transpilation thanks to options like 'rewriteRelativeImportExtensions'.
The project single dependency is the Node.js types, with a straightforward file structure that facilitates ease of use and testing.
Collection
[
|
...
]