{"library":"node-typescript-compiler","title":"Node TypeScript Compiler Wrapper","description":"node-typescript-compiler is a Node.js module that exposes the functionality of the TypeScript compiler (tsc) by spawning the tsc command-line tool as a child process. This allows developers to programmatically invoke tsc from within a Node.js script, enabling advanced build workflows such as compiling multiple variants of modules (e.g., Node/browser) with different compiler options. The current stable version is 4.0.0. While a formal release cadence is not specified, a maintenance badge from 2023 indicates ongoing support. A key differentiator is its simple, reliable wrapper around the tsc CLI, which properly catches and reports compilation errors. It treats `typescript` itself as a peer dependency, giving users explicit control over which tsc version is used. This design promotes a clear separation of concerns, ensuring that node-typescript-compiler acts primarily as an orchestrator for the standard TypeScript toolchain.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install node-typescript-compiler"],"cli":null},"imports":["import tsc from 'node-typescript-compiler';","import tsc from 'node-typescript-compiler'; await tsc.compile(...);"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import tsc from 'node-typescript-compiler';\n\nasync function compileProject() {\n  try {\n    console.log('Starting TypeScript compilation...');\n    await tsc.compile({\n      'project': '.' // Refers to tsconfig.json in the current directory\n    });\n    console.log('TypeScript compilation successful.');\n  } catch (error) {\n    console.error('TypeScript compilation failed:', error.message);\n    process.exit(1);\n  }\n}\n\ncompileProject();","lang":"javascript","description":"This quickstart compiles the current TypeScript project using the `tsconfig.json` located in the current directory.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}