A transpiler that enables use of ES6 yield statements in TypeScript before native support was available. Version 0.1.2 is a proof-of-concept with limited documentation. It transforms yield-based async patterns (often used with the 'suspend' library) into plain JavaScript. The tool requires manual preparation of type definition files and forbids the use of 'yield' anywhere else in the codebase. It has been largely superseded by native async/await and TypeScript's built-in generator support. Not recommended for new projects.
npm install typescript-yieldNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use typescript-yield with the suspend library: define async function with callback, then use yield and resume.
Prefer native async/await or TypeScript's built-in generator support (function*).
Avoid using 'yield' outside of the transpiler context; rename variables or use alternative wording.
Always work on a copy of your files, or version-control before running the transpiler.
Ensure all async calls follow the exact yield + resume pattern as shown in documentation.
Run 'ts-yield' on your source files before compilation. 'yield' is only available after transpilation.
Add a type declaration for 'yield' (e.g., declare function yield(...args: any[]): any;) or run the transpiler before tsc.
Manually adjust the return type annotation on the async function, or ensure the transpiler output functions have correct signatures.
No dependency data recorded yet.