{"id":26006,"library":"node-tsc","title":"node-tsc","description":"node-tsc wraps the TypeScript command-line compiler (tsc) as a Node.js module, enabling programmatic compilation of TypeScript files. Version 0.0.14 is the latest stable release, last updated in 2015. It provides a simple API to compile TypeScript code without invoking the CLI. Notable issues: the package is unmaintained, very outdated, and does not support modern TypeScript features (ES modules, strict mode). Dependencies are minimal: only Node.js and a TypeScript compiler from npm (installed separately). Key differentiator: simple wrapper for tsc, but now obsolete; use ts-node, @ts-morph/bootstrap, or the official TypeScript API instead.","status":"deprecated","version":"0.0.14","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/sergeyt/node-tsc","tags":["javascript","typescript"],"install":[{"cmd":"npm install node-tsc","lang":"bash","label":"npm"},{"cmd":"yarn add node-tsc","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-tsc","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"requires tsc to be installed globally or locally","package":"typescript","optional":false}],"imports":[{"note":"Package uses CommonJS; ESM import not supported.","wrong":"import tsc from 'node-tsc';","symbol":"default export","correct":"const tsc = require('node-tsc');"},{"note":"Callback style; no promise-based API.","wrong":"","symbol":"compile()","correct":"tsc.compile(['file.ts'], { outDir: 'dist' }, function(err, output) { ... });"},{"note":"Synchronous variant for convenience.","wrong":"","symbol":"compileSync()","correct":"var result = tsc.compileSync(['file.ts'], { outDir: 'dist' });"}],"quickstart":{"code":"const tsc = require('node-tsc');\nconst options = {\n  outDir: 'dist',\n  module: 'commonjs',\n  target: 'es5',\n  sourceMap: true\n};\ntsc.compile(['src/index.ts'], options, function(err, output) {\n  if (err) {\n    console.error('Compilation error:', err);\n  } else {\n    console.log('Compilation succeeded');\n    console.log('Output files:', output);\n  }\n});","lang":"typescript","description":"Shows programmatic TypeScript compilation using compile() with callback."},"warnings":[{"fix":"Replace with ts-node, @ts-morph/bootstrap, or TypeScript's compiler API directly.","message":"Package is unmaintained and outdated; use official TypeScript API instead.","severity":"deprecated","affected_versions":"*"},{"fix":"Run 'npm install typescript' in your project.","message":"The package does not install TypeScript as a dependency; you must install typescript separately.","severity":"gotcha","affected_versions":"*"},{"fix":"Test with your TypeScript version; consider using official API for better compatibility.","message":"Options are passed directly to tsc; some options may not work as expected due to old version compatibility.","severity":"gotcha","affected_versions":"*"},{"fix":"Use official TypeScript API or tools like ts-project-utils.","message":"No support for TypeScript project references or incremental compilation.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install typescript'.","cause":"node-tsc requires typescript to be installed, but it is not a dependency.","error":"Error: Cannot find module 'typescript'"},{"fix":"Use 'const tsc = require('node-tsc');' instead of 'import tsc from 'node-tsc';'.","cause":"Incorrect import: trying to use default import instead of require.","error":"TypeError: tsc.compile(...) is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}