Socket
Book a DemoInstallSign in
Socket

@foxssake/trimsock-js

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@foxssake/trimsock-js

A reference implementation of the [trimsock protocol] for JavaScript and TypeScript.

latest
npmnpm
Version
0.19.0
Version published
Maintainers
1
Created
Source

@foxssake/trimsock-js

A reference implementation of the trimsock protocol for JavaScript and TypeScript.

Features

  • 📦 Zero-dependency
  • ✅ Parser implementing the full spec
  • 🚀 Includes base classes for building applications

[!NOTE] This package by itself doesn't handle any network communication. For that, try trimsock-bun or trimsock-node.

Usage

Install the package, using the command appropriate for your environment:

npm install @foxssake/trimsock-js
pnpm add @foxssake/trimsock-js
yarn add @foxssake/trimsock-js
bun add @foxssake/trimsock-js

Install an adapter for communication, for example trimsock-bun:

npm install @foxssake/trimsock-bun
pnpm add @foxssake/trimsock-bun
yarn add @foxssake/trimsock-bun
bun add @foxssake/trimsock-bun

Implement your server:

import { BunSocketReactor } from "@foxssake/trimsock-bun";

new BunSocketReactor()
  .on("echo", (cmd, exchange) => exchange.replyOrSend(cmd))
  .onError((cmd, exchange, error) => console.error("Error occured processing command:", error))
  .listen({
    hostname: "localhost",
    port: 8890,
    socket: {
      open(socket) {
        // Event handlers are supported as well
        console.log("New connection!")
      }
    }
  })

License

This package is under the MIT License.

FAQs

Package last updated on 26 Nov 2025

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