Socket
Book a DemoInstallSign in
Socket

@foxssake/trimsock-node

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@foxssake/trimsock-node

Provides support for using [trimsock-js] with [node.js].

latest
npmnpm
Version
0.19.0
Version published
Maintainers
1
Created
Source

@foxssake/trimsock-node

Provides support for using trimsock-js with node.js.

Features

  • 🔃 TCP Socket support

Usage

Install trimsock-js, 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 the package:

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

Implement a server:

import { NodeSocketReactor } from "@foxssake/trimsock-node";

const port = 8890
new NodeSocketReactor()
  .on("echo", (cmd, exchange) => exchange.replyOrSend(cmd))
  .onError((cmd, exchange, error) => console.error("Failed to process command:", command, error))
  .serve({}, (socket) => {
    // Custom event handlers are supported
    console.log("New connection!");
  })
  .listen(port, () => console.log("Listening on port", port));

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