File tree Expand file tree Collapse file tree 1 file changed +32
-2
lines changed Expand file tree Collapse file tree 1 file changed +32
-2
lines changed Original file line number Diff line number Diff line change 1
1
typescript-service
2
2
===
3
+ Language service which helps to get diagnostic messages from typescript source files.
3
4
5
+ ## INSTALL
6
+ ```
7
+ npm install --save-dev typescript-service
8
+ ```
4
9
5
- CHANGELOG
6
- ---
10
+ ## USAGE
11
+ ``` ts
12
+ import { createService } from ' typescript-service' ;
13
+
14
+ const service = createService ({ configFile , compilerOptions });
15
+ const diagnostics = service .getDiagnostics (fileName );
16
+ ```
17
+
18
+ ## API
19
+ ```
20
+ createService({ configFile, compilerOptions })
21
+ ```
22
+ ` configFile ` (required, string) Path to tsconfig.json file
23
+ ` compilerOptions ` (optional, Object) Compiler options to overwrite defined in tsconfig.json
24
+
25
+ Returns object with properties which are functions:
26
+
27
+ * ` update({ fileName: string, fileContent?: string }) ` Update (add) information about file in typescript service
28
+ ` fileName ` (required, string) Path to typescript file
29
+ ` fileContent (optional, string) ` File content of this file
30
+
31
+ * ` getDiagnostics(fileName: string): Array<ts.DiagnosticWithLocation> ` Get diagnostic messages for ` fileName `
32
+ ` fileName ` (required, string) Path to typescript file
33
+
34
+ * ` getProgram(): ts.Program ` Get ` ts.Program `
35
+
36
+ ## CHANGELOG
7
37
See [ CHANGELOG.md] ( CHANGELOG.md )
You can’t perform that action at this time.
0 commit comments