Registry / node-tsc

node-tsc

JSON →
library0.0.14jsnpmunverified

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.

npm install node-tsc
INSTALL
IMPORT
SIG · NODE-TSC
N
node-tsc
javascriptv0.0.14
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default export
const tsc = require('node-tsc');
import tsc from 'node-tsc';
Package uses CommonJS; ESM import not supported.
compile()
tsc.compile(['file.ts'], { outDir: 'dist' }, function(err, output) { ... });
Callback style; no promise-based API.
compileSync()
var result = tsc.compileSync(['file.ts'], { outDir: 'dist' });
Synchronous variant for convenience.

Shows programmatic TypeScript compilation using compile() with callback.

const tsc = require('node-tsc'); const options = { outDir: 'dist', module: 'commonjs', target: 'es5', sourceMap: true }; tsc.compile(['src/index.ts'], options, function(err, output) { if (err) { console.error('Compilation error:', err); } else { console.log('Compilation succeeded'); console.log('Output files:', output); } });
Debug
Known issues
deprecatedPackage is unmaintained and outdated; use official TypeScript API instead.
fix
Replace with ts-node, @ts-morph/bootstrap, or TypeScript's compiler API directly.
affects: *
gotchaThe package does not install TypeScript as a dependency; you must install typescript separately.
fix
Run 'npm install typescript' in your project.
affects: *
gotchaOptions are passed directly to tsc; some options may not work as expected due to old version compatibility.
fix
Test with your TypeScript version; consider using official API for better compatibility.
affects: *
gotchaNo support for TypeScript project references or incremental compilation.
fix
Use official TypeScript API or tools like ts-project-utils.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'typescript'
node-tsc requires typescript to be installed, but it is not a dependency.
fix
Run 'npm install typescript'.
TypeError: tsc.compile(...) is not a function
Incorrect import: trying to use default import instead of require.
fix
Use 'const tsc = require('node-tsc');' instead of 'import tsc from 'node-tsc';'.
Upgrade
Version history
0.0.14latest on npm
Audit
Dependencies
typescriptrequiredrequires tsc to be installed globally or locally
Agent activity
4 hits · last 30 days
node
4
Resources
node-tsc — npm install node-tsc · libregistry