Skip to main content
Home

latest
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
82%
Published
a year ago (3.0.0)

lsp_stream

It provides Decoder/Encoder of Base Protocol of Language Server Protocol

import { LspEncoderStream } from "./lsp_stream.ts";
import { JsonStringifyStream } from "jsr:/@std/json@0.222.1";

const stream = new JsonStringifyStream();
const writer = stream.writable.getWriter();
stream.readable
  .pipeThrough(new LspEncoderStream())
  .pipeTo(Deno.stdout.writable);
await writer.write({ foo: "bar" });
await writer.write({ baz: 100 });
import { LspDecoderStream } from "./lsp_stream.ts";

const stream = Deno.stdin.readable
  .pipeThrough(new LspDecoderStream());
const reader = stream.getReader();
const result = await reader.read();
if (!result.done) {
  const msg = JSON.parse(result.value);
}

License

NYSL

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@kuuote/lsp-stream

Import symbol

import * as lsp_stream from "@kuuote/lsp-stream";
or

Import directly with a jsr specifier

import * as lsp_stream from "jsr:@kuuote/lsp-stream";

Add Package

pnpm i jsr:@kuuote/lsp-stream
or (using pnpm 10.8 or older)
pnpm dlx jsr add @kuuote/lsp-stream

Import symbol

import * as lsp_stream from "@kuuote/lsp-stream";

Add Package

yarn add jsr:@kuuote/lsp-stream
or (using Yarn 4.8 or older)
yarn dlx jsr add @kuuote/lsp-stream

Import symbol

import * as lsp_stream from "@kuuote/lsp-stream";

Add Package

npx jsr add @kuuote/lsp-stream

Import symbol

import * as lsp_stream from "@kuuote/lsp-stream";

Add Package

bunx jsr add @kuuote/lsp-stream

Import symbol

import * as lsp_stream from "@kuuote/lsp-stream";