Resolve and parse tsconfig.json, with support for filesGlob (array of glob strings).
See the TypeScript wiki for information on setting up tsconfig.json. Additionally, this module will parse the filesGlob option, if it exists.
- resolve(dir: string): Promise Find up the location of
tsconfig.json. - resolveSync(dir: string): string Synchronous
resolve. - load(dir: string, options?: Options): Promise Resolve, load and parse
tsconfig.json. - loadSync(dir: string): TSConfig Synchronous
load. - readFile(filename: string, options?: Options): Promise Read a file as
tsconfig.json(BOM, JSON parse, empty file andfilesexpansion). - readFileSync(filename: string, options?: Options): TSConfig Synchronous
readFile. - parseFile(contents: string, filename: string, options?: Options): Promise Parse a string as
tsconfig.json(BOM, JSON parse, empty contents and expansion). - parseFileSync(contents: string, filename: string, options?: Options): TSConfig Synchronous
parseFile. - resolveConfig(config: TSConfig, filename: string, options?: Options): Promise Expand a raw
tsconfig.jsonobject. - resolveConfigSync(config: TSConfig, filename: string, options?: Options): TSConfig Synchronous
resolveConfig.
The TSConfig result will always contain an expanded files array (from either filesGlob or exclude). Both files and exclude will be resolved relative to the tsconfig.json file.
- compilerOptions Default compiler options to apply on expansion (default:
{}). - filterDefinitions Return a list files which are only
.d.tsfiles (default:false). - resolvePaths Resolve paths to absolute and remove duplicate entries (default:
true).
Please open issues for discussion.
MIT License