Language service which helps to get diagnostic messages from typescript source files.
npm install --save-dev typescript-service
import { createService } from 'typescript-service';
const service = createService({ configFile, compilerOptions });
const diagnostics = service.getDiagnostics(fileName);
configFile
(required, string) Path to tsconfig.json filecompilerOptions
(optional, Object) Compiler options to overwrite defined in tsconfig.json
Returns object with properties which are functions:
Update (add) information about file in typescript service.
fileName
(required, string) Path to typescript filesourceText
(optional, string) File content of this file
Get diagnostic messages for fileName
fileName
(required, string) Path to typescript filesourceText
(optional, string) If path outside of scope defined in tsconfig you need providesourceText
Get ts.Program
See CHANGELOG.md