{"id":17995034,"url":"https://github.com/cyyynthia/hazeljs","last_synced_at":"2025-06-16T05:39:48.525Z","repository":{"id":57105242,"uuid":"331039779","full_name":"cyyynthia/hazeljs","owner":"cyyynthia","description":"TypeScript implementation of the Hazel-Networking C# net library.","archived":false,"fork":false,"pushed_at":"2021-01-21T10:05:26.000Z","size":58,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"mistress","last_synced_at":"2025-03-10T11:36:02.267Z","etag":null,"topics":["among-us","hazel","networking","udp"],"latest_commit_sha":null,"homepage":"https://npm.im/@cyyynthia/hazeljs","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyyynthia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"ko_fi":"cyyynthia"}},"created_at":"2021-01-19T16:22:25.000Z","updated_at":"2021-05-04T13:25:18.000Z","dependencies_parsed_at":"2022-08-20T23:50:07.536Z","dependency_job_id":null,"html_url":"https://github.com/cyyynthia/hazeljs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyyynthia%2Fhazeljs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyyynthia%2Fhazeljs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyyynthia%2Fhazeljs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyyynthia%2Fhazeljs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyyynthia","download_url":"https://codeload.github.com/cyyynthia/hazeljs/tar.gz/refs/heads/mistress","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247125530,"owners_count":20887721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["among-us","hazel","networking","udp"],"created_at":"2024-10-29T20:17:43.785Z","updated_at":"2025-04-04T05:25:18.340Z","avatar_url":"https://github.com/cyyynthia.png","language":"TypeScript","funding_links":["https://ko-fi.com/cyyynthia","https://ko-fi.com/G2G71TSDF"],"categories":[],"sub_categories":[],"readme":"# HazelJS\n[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/G2G71TSDF)\u003cbr\u003e\n[![License](https://img.shields.io/github/license/cyyynthia/hazeljs.svg?style=flat-square)](https://github.com/cyyynthia/hazeljs/blob/mistress/LICENSE)\n[![npm](https://img.shields.io/npm/v/@cyyynthia/hazeljs?style=flat-square)](https://npm.im/@cyyynthia/hazeljs)\n\nTypeScript implementation of the [Hazel-Networking](https://github.com/willardf/Hazel-Networking) C# net library.\n\n**Note**: This is alpha-quality software which is most likely not suitable for production applications. It hasn't\nreally been tested and the probability of it exploding catastrophically is 0.9. It's also very likely to receive\nbreaking changes at any given time.\n\n## Requirements\nNodeJS 14+ (HazelJS is esm only)\n\n## Installation\n```\nnpm i @cyyynthia/hazeljs\nyarn add @cyyynthia/hazeljs\npnpm i @cyyynthia/hazeljs\n```\n\n## Usage\nThe docs only shows basic usage, and aren't super detailed. I'll eventually add better docs once the lib is more\nstable and in a production-ready shape. For now, autocomplete is your best friend:tm:\n\n### Server\nHere's a basic example:\n```js\nimport { Server } from '@cyyynthia/hazeljs'\n\nconst server = new Server() // To create an IPv6 server: new Server(true)\nserver.on('connection', (connection, hello) =\u003e {\n  console.log(`New connection from ${connection.remote.address}:${connection.remote.port}`)\n  console.log(`Hello payload:`, hello)\n\n  connection.on('message', (msg) =\u003e {\n    console.log('Message received', msg)\n    // Here we just echo it back, but you'd normally process the message and eventually\n    // reply with a more appropriated response.\n    connection.sendNormal(msg)\n  })\n\n  connection.on('close', () =\u003e {\n    console.log(`Connection with ${connection.remote.address}:${connection.remote.port} closed.`)\n  })\n})\n\nserver.listen(1337, '127.0.0.1')\n```\n\n### Client\n```js\nimport { Client } from '@cyyynthia/hazeljs'\n\nconst client = new Client() // To create an IPv6 client: new Client('127.0.0.1', 1337, true)\n\nclient.on('connected', () =\u003e {\n  console.log('Connected!')\n\n  client.sendNormal(...)\n})\n\nclient.on('message', (msg) =\u003e {\n  console.log('Message received', msg)\n})\n\nclient.connect()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyyynthia%2Fhazeljs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyyynthia%2Fhazeljs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyyynthia%2Fhazeljs/lists"}