0.0.48 • Published 6 years ago

@wessberg/typescript-language-service v0.0.48

Weekly downloads
21
License
MIT
Repository
github
Last release
6 years ago

TypescriptLanguageServiceHost

NPM version License-mit

A host-implementation of Typescripts LanguageService.

Installation

Simply do: npm install @wessberg/typescript-language-service.

What is it

This is an implementation of Typescript's LanguageService. It can resolve .ts and .js files and builds up an AST from both kinds of files. It can recursively add all imports of a module to the AST if required. Otherwise it can be used to parse and generate Statements, Expressions and (Typescript) Nodes from source code.

Additionally, if a file is added (either directly or automatically) that has a definition file (.d.ts) with the same name in the same directory, it will merge the two before adding the file to the LanguageService.

Usage

const languageService = new TypescriptLanguageServiceHost();
languageService.addFile({
	path: "foo.ts",
	content: `
		import {bar} from "./bar";
		export const foo = bar + 2;
	`,
	addImportedFiles: true
});
0.0.48

6 years ago

0.0.46

6 years ago

0.0.45

6 years ago

0.0.44

6 years ago

0.0.43

6 years ago

0.0.41

6 years ago

0.0.39

6 years ago

0.0.37

6 years ago

0.0.36

6 years ago

0.0.35

6 years ago

0.0.34

6 years ago

0.0.33

6 years ago

0.0.32

7 years ago

0.0.31

7 years ago

0.0.29

7 years ago

0.0.28

7 years ago

0.0.27

7 years ago

0.0.25

7 years ago

0.0.24

7 years ago

0.0.23

7 years ago

0.0.22

7 years ago

0.0.21

7 years ago

0.0.20

7 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.2

7 years ago