Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typescript-service

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-service

Language service which helps to get diagnostic messages from typescript source files.

  • 2.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

typescript-service

Language service which helps to get diagnostic messages from typescript source files.

INSTALL

npm install --save-dev typescript-service

USAGE

import { createService } from 'typescript-service';

const service = createService({ configFile, compilerOptions });
const diagnostics = service.getDiagnostics(fileName);

API

createService({ configFile: string, compilerOptions?: ts.CompilerOptions })
  • configFile (required, string) Path to tsconfig.json file
  • compilerOptions (optional, Object) Compiler options to overwrite defined in tsconfig.json

Returns object with properties which are functions:

getSourceFile({ fileName: string, sourceText?: string })

Update (add) information about file in typescript service.

  • fileName (required, string) Path to typescript file
  • sourceText (optional, string) File content of this file
getDiagnostics: (fileName: string, sourceText?: string): Array<ts.DiagnosticWithLocation>

Get diagnostic messages for fileName

  • fileName (required, string) Path to typescript file
  • sourceText (optional, string) If path outside of scope defined in tsconfig you need provide sourceText
getProgram(): ts.Program

Get ts.Program

CHANGELOG

See CHANGELOG.md

FAQs

Package last updated on 28 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc