Registry / devops / typescript-plus

typescript-plus

JSON →
library3.1.5jsnpmunverified

An enhanced TypeScript compiler (v3.1.5) built on top of tsc 3.1.3, adding features like accessor optimization, class reflection metadata emission, conditional compilation via defines, and automatic file reordering based on dependency analysis. Primarily maintained as part of the Egret Engine ecosystem. Releases track upstream TypeScript versions but lag behind, with current stable based on 3.1.3. Use this if you need its extra features, but be aware of possible incompatibility with standard TypeScript tooling and potential build issues due to non-standard compiler behavior. Not recommended for general-purpose projects unless you depend on Egret or its specific enhancements.

npm install typescript-plus
INSTALL
IMPORT
SIG · TYPESCRIPT-PLUS
T
typescript-plus
devopsjavascriptv3.1.5
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.

tsc-plus
npx tsc-plus --reorderFiles
tsc-plus --reorderFiles
Use npx to run the CLI without global install; the binary is 'tsc-plus', not 'tcs' or 'typescript-plus'.
compiler API
import * as ts from 'typescript-plus'
const ts = require('typescript-plus')
Package ships TypeScript types; use ESM import for type safety. CJS require works but lacks type inference.
createProgram
import { createProgram } from 'typescript-plus'
import { createProgram } from 'typescript'
Symbols are re-exported from the TypeScript API; ensure you import from 'typescript-plus', not 'typescript'.

Shows tsconfig.json with extra options and both CLI and programmatic compilation using typescript-plus.

// Create a simple tsconfig.json with extra features { "compilerOptions": { "target": "es5", "module": "commonjs", "emitReflection": true, "reorderFiles": true, "defines": { "DEBUG": false } }, "files": ["index.ts"] } // Then compile: // npx tsc-plus --reorderFiles // Programmatic usage: import * as ts from 'typescript-plus'; const program = ts.createProgram(['index.ts'], { target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS, emitReflection: true, reorderFiles: true, defines: { DEBUG: false } }); const emitResult = program.emit();
tsp --version
Debug
Known issues
breakingThis package lags behind upstream TypeScript versions by several releases; using it with modern TypeScript features may cause errors.
fix
Use official TypeScript for modern code; typescript-plus is intended for Egret Engine compatibility.
affects: >=3.1.5
gotchaThe 'reorderFiles' option can change module load order unexpectedly, potentially breaking code that relies on side effects of module declaration order.
fix
Set 'reorderFiles' to false if your code depends on file order, or ensure no side effects in modules.
affects: >=2.0.0
gotchaThe 'defines' option replaces global variables at compile time but does not work with const or let; only var or global declarations can be replaced.
fix
Use 'var DEBUG = true;' in source code and define in tsconfig as 'defines: { DEBUG: false }'.
affects: >=2.0.0
deprecatedThis package is not actively maintained for new TypeScript versions; last update tracked tsc 3.1.3.
fix
Consider migrating to official TypeScript and isolate Egret-specific features if needed.
affects: >=3.1.5
criticalSecurity vulnerability: this package has transitive dependencies on outdated versions of 'chalk' and 'supports-color' with known CVE-2023-26102 (prototype pollution).
fix
Audit your lockfile and consider npm audit fix; if not used in production, this may be low priority.
affects: >=2.0.0
breakingThe 'emitReflection' option produces non-standard metadata that may not be consumed by standard reflect-metadata polyfill; it outputs a custom format.
fix
Only use 'emitReflection' if your runtime (e.g., Egret) explicitly supports the output format.
affects: >=2.0.0
Errors
Common errors & fixes
error TS5023: Unknown compiler option 'accessorOptimization'.
Using the option with official tsc instead of typescript-plus binary.
fix
Run 'npx tsc-plus' instead of 'npx tsc'.
Cannot find module 'typescript-plus'
Package not installed, or wrong import path in Node.js (CJS vs ESM).
fix
Run 'npm install typescript-plus' and use 'import * as ts from "typescript-plus"' (ESM) or 'const ts = require("typescript-plus")' (CJS).
TypeError: ts.createProgram is not a function
Importing from 'typescript' instead of 'typescript-plus'.
fix
Change import to 'import { createProgram } from "typescript-plus"'.
error TS6046: Name 'DEBUG' not found in 'defines'.
defines option expects a string key matching a variable declared with 'var' or a global.
fix
Ensure the variable is declared as 'var DEBUG = true;' at global scope, not 'const' or 'let'.
Error: Cannot find module 'typescript' from 'typescript-plus'
typescript-plus has an optional dependency on 'typescript' that may be missing.
fix
Install typescript as a peer dependency: 'npm install typescript@3.1.3'.
Upgrade
Version history
3.1.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
typescript-plus — npm install typescript-plus · libregistry