RhiNode
Javascript wrapper of Java's NIO with a node.js-like API.
Install / Use
/learn @lhofhansl/RhiNodeREADME
RhiNode should be considered stale. Please check out RhiNodeII (also on GitHub). RhiNodeII started from scratch and is sufficiently different from RhiNode to warrant a new project.
The RhiNode repository will be deleted soon.
RhiNode provides a Javascript API around Java's NIO library.
This was bourne out of frustration over claims that NIO is slow and does not scale and the fun in functional programming.
The API itself is very heavily inspired by node.js. Where feasible and sensible the API is compatible to node.js.
Common.js type modules are used to encapulate functionality.
The current abstractions include: o events o fs (filesystem) o net o http
No serious attempt towards optimization have been made, yet. For example the http module only uses the "public" net API with no shortcuts. The main event loop is currently implemented in Javascript as well.
The only tight loop implemented directly in Java is the scanning of the network buffers for line-endings and http headers.
Since NIO does not provide selectable FileChannel, files are currently treated as streams (channels) that are alway readable and writable.
This is version 0.1, it works pretty for me and performs pretty well. But there are a bunch of hacks and shortcuts that need to be addressed.
For integration with Rhino a bunch of files where copied from the Rhino distribution and slightly modified. The changed are packaged in a separate jar and can used with standard Rhino installation. You need the latest Rhino 1.7r3, though (a pristine jar is included).
To get started: #build/install ant -Ddist=<installDir> #run a simple http server <installDir>/rhinode example/http-1.1-content-length.js
Related Skills
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
