tsc-extra
v0.1.0-beta.3
Published
A minimal wrapper around TypeScript's compiler API
Readme
tsc-extra
Minimal wrapper around the TypeScript compiler API for source-analysis tools.
Installation
npm install tsc-extra typescriptMinimal Use
import { createProject } from 'tsc-extra'
const project = await createProject(process.cwd())
const sourceFile = project.getSourceFileOrThrow('src/index.ts')
const checker = project.getTypeChecker()
const type = checker.getTypeAtLocation(sourceFile)Documentation
- Concepts and lifecycle: docs/context.md
- Runnable example: examples/inspect-project.ts
- Exact public signatures: generated
dist/index.d.ts - Source-owned API behavior:
src/Project.ts,src/TsConfigLoader.ts, andsrc/errors.ts
Public Entry Points
import {
FileNotFoundError,
createProject,
createProjectFactory,
} from 'tsc-extra'
import type { Project, ProjectOptions, TsConfig } from 'tsc-extra'