package
TypeScript implementation of the Hazel-Networking C# net library.
npm install @cyyynthia/hazeljsGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Estimated unpacked size across 1 packages.
39.0 kB
Includes dependencies.
TypeScript implementation of the Hazel-Networking C# net library.
Note: This is alpha-quality software which is most likely not suitable for production applications. It hasn't really been tested and the probability of it exploding catastrophically is 0.9. It's also very likely to receive breaking changes at any given time.
NodeJS 14+ (HazelJS is esm only)
npm i @cyyynthia/hazeljs
yarn add @cyyynthia/hazeljs
pnpm i @cyyynthia/hazeljsThe docs only shows basic usage, and aren't super detailed. I'll eventually add better docs once the lib is more stable and in a production-ready shape. For now, autocomplete is your best friend:tm:
Here's a basic example:
import { Server } from '@cyyynthia/hazeljs'
const server = new Server() // To create an IPv6 server: new Server(true)
server.on('connection', (connection) => {
console.log(`New connection from ${connection.remote.address}:${connection.remote.port}`)
connection.on('hello', (msg) => {
console.log('Hello received', msg)
})
connection.on('message', (msg) => {
console.log(
The client hasn't been implemented in HazelJS yet. :(