Registry / devops / typescript-closure-compiler

typescript-closure-compiler

JSON →
library1.8.11jsnpmunverified

Patches the TypeScript compiler to generate JSDoc annotations for Google Closure Compiler integration. Stable version 1.8.11 is compatible with TypeScript 1.8.10. Release cadence matches TypeScript major.minor versions. This package is a niche tool specifically for combining TypeScript with Closure Compiler's advanced optimizations, unlike general-purpose TypeScript compilers. It provides a CLI command `tscc` that replaces `tsc` and adds options for entry points, exports, and externs. Not actively maintained; last release in 2016. Users should be aware of TypeScript version lock-in and potential issues with modern TypeScript features.

npm install typescript-closure-compiler
INSTALL
IMPORT
SIG · TYPESCRIPT-CLOSURE
T
typescript-closure-compiler
devopsjavascriptv1.8.11
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.

tscc
npx tscc app.ts
npm install -g typescript-closure-compiler && tscc app.ts
CLI tool; install globally or use npx. Not a library import.
default export (none)
No programmatic API exposed; use CLI or gulp plugin.
import { compile } from 'typescript-closure-compiler'
Package does not export any JavaScript API; only CLI.
gulp-typescript-closure-compiler
const gulpTscc = require('gulp-typescript-closure-compiler')
import gulpTscc from 'typescript-closure-compiler'
Separate gulp plugin package, not this package.

Demonstrates installation, basic usage, common options (entry, export, externs), and tsconfig.json usage for the tscc CLI.

// Install globally npm install -g typescript-closure-compiler // Compile a TypeScript file tscc app.ts // With options: entry point and export name tscc app.ts --module commonjs --entry app.ts --exportAs App // Using tsconfig.json with externs // tsconfig.json: { "compilerOptions": { "module": "commonjs" }, "files": ["app.ts"], "externs": ["externs/app-externs.d.ts"], "externsOutFile": "externs.js" } // Then run: tscc --project .
tscc --version
Debug
Known issues
breakingPackage is compatible only with TypeScript 1.8.10. Using with newer TypeScript versions will likely break.
fix
Pin to TypeScript 1.8.x; do not upgrade TypeScript without upgrading this package.
affects: >=2.0
deprecatedProject appears abandoned; last release 2016, no updates since.
fix
Consider alternatives like tsickle or direct Closure Compiler usage.
affects: all
gotchaThe --module flag is only for compilation; modules are not preserved in output because all code is bundled into one file.
fix
Do not rely on module syntax in output; code will be concatenated into a single file without module wrappers.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'typescript'
typescript-closure-compiler requires TypeScript 1.8.10 installed in the same directory or globally.
fix
Run 'npm install -g typescript@1.8.10' alongside typescript-closure-compiler.
error TS5023: Unknown compiler option 'externs'.
Using typescript-closure-compiler (tscc) instead of tsc? The option 'externs' is only supported by tscc.
fix
Use 'tscc' command instead of 'tsc' when employing package-specific options.
Upgrade
Version history
1.8.11latest on npm
Audit
Dependencies
typescriptrequiredThe patched compiler is built on TypeScript 1.8.10 and may not work with other versions.
Agent activity
6 hits · last 30 days
node
6
Resources
typescript-closure-compiler — npm install typescript-closure-compiler · libregistry