tslang-client ·
A client implementation for tsserver
for TypeScript.
Currently, it's just working but not completely tested.
You can see the details about tsserver
in the TypeScript wiki
Rationale
TypeScript provides a powerful Type System. So I was trying to leverage the Type System to make good tooling environment for TypeScript based projects. and I found some facts:
- TypeScript provides full-featured Compiler API but slow and complicated.
- ts-simple-ast provides well-designed wrapper API around the Compiler API but slow for my needs.
tsserver
is fast but there is no library for communication withtsserver
.
So I made this.
Requirements
- TypeScript 2.8 or above
Installation
npm install --save-dev tslang-client
Usage
; // Create a client instance; // Connect to installed tsserverawait client.connect; // Call open(file) apiawait client.api.open; // Close the connectionclient.close;
Import with CommonJS
tslang-client
supports CommonJS-style module along with the ES2015-style.
const TsLangClient = ;