New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ts-expose-status-plugin

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-expose-status-plugin

TypeScript language service plugin to expose build status to external tools

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

TypeScript expose status plugin

This is a TS language service plugin that exposes the current build state to the outside world. For example, you can use this to write a fast pre-commit check there are no TypeScript errors. Rather than needing to redo the typechecking from scratch, a CLI tool can connect directly to the language service running in your editor, which generally gives much faster results.

Usage

First add as a dev dependency:

yarn add --dev ts-expose-status-plugin

Then add as a compiler plugin to your tsconfig.json:

{
  "compilerOptions": {
    "plugins": [
      {"name": "ts-expose-status-plugin"}
    ]
  }
}

Then, from CLI code, you can connect to the language service and get all current errors:

import TSStatusClient from 'ts-expose-status-plugin/dist/TSStatusClient';

async function checkStatus(): void {
  await TSStatusClient.withClient({
    async onSuccess(client: TSStatusClient): Promise<void> {
      const errors = await client.getAllErrors();
      console.log(errors);
    },
    async onError(): Promise<void> {
      console.log('Failed to connect!');
    },
  });
}

There are also lower-level connect and disconnect static methods for keeping a persistent connection open.

FAQs

Package last updated on 23 Jan 2021

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