Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
ziv/jsocketRead and write stream. Supports ReadableStream, WritableStream, and Node.js streams.
This package works with Node.js, Deno, Bun


JSR Score
94%
Published
6 months ago (0.28.8)
This package provides a simple way to create a server/client communication (request/response method) using unix sockets.
The package supports both Deno
and Node.js
.
Installation
deno add jsr:@xpr/jsocket npm i @xpr/jsocket
Read and write data from streams.
All read and write operations are throttled to avoid memory exhaustion.
read from a readable stream
read from a readable stream
import read from "@xpr/jsocket/read"; const stream = getReadableStream(); const data = await read(stream);
write to any writable stream
write to any writable stream
import write from "@xpr/jsocket/write"; const stream = getWritableStream(); await write(stream, data);
Creating a Unix socket server and client
Built and signed on
GitHub Actions
Add Package
deno add jsr:@xpr/jsocket
Import symbol
import * as jsocket from "@xpr/jsocket";
Import directly with a jsr specifier
import * as jsocket from "jsr:@xpr/jsocket";
Add Package
pnpm i jsr:@xpr/jsocket
pnpm dlx jsr add @xpr/jsocket
Import symbol
import * as jsocket from "@xpr/jsocket";
Add Package
yarn add jsr:@xpr/jsocket
yarn dlx jsr add @xpr/jsocket
Import symbol
import * as jsocket from "@xpr/jsocket";
Add Package
vlt install jsr:@xpr/jsocket
Import symbol
import * as jsocket from "@xpr/jsocket";
Add Package
npx jsr add @xpr/jsocket
Import symbol
import * as jsocket from "@xpr/jsocket";
Add Package
bunx jsr add @xpr/jsocket
Import symbol
import * as jsocket from "@xpr/jsocket";