-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node.js bindings #234
Comments
Dude, this is awesome. I'll try to take a look soon and not keep you and your PR hanging. This is something we've wanted to properly support for a long time. |
Nice to hear. I'm sure many improvements are possible, but it works and I've tried to make a solid base to work off of. That being said, documentation is a bit sparse, so let me know if anything needs clarification. |
Closing this to consolidate discussion into your PR #235 |
Last month I've worked on new bindings for node.js in typescript using
node-gyp
andnode-addon-api
. Blocking calls are made asynchronous, using the latter API to interact withlibuv
. TCP matches closely to nodesnet
module and should be interoperable with e.g. thehttp
module. Same for UDP (node:dgram
), though UDP does not support connections yet (instead specify destination every time).It's not finished, but I've had less time to work on it so thought I'd share it already, to also get some feedback. Biggest issue currently is figuring out how to best build/package it, something I don't have much experience with. (It's also currently Linux only as I don't have Windows or Mac to test on, it's hopefully just configuring the paths.)
Code is here: https://github.com/janvanbouwel/libzt/tree/node/src/bindings/nodejs (I'll create a PR as well)
https://github.com/janvanbouwel/libzt/tree/node-test-release is an attempt at packaging it. It includes a prebuilt
libzt.a
. It can be installed using npm, which builds the bindings and links it automatically. The only issue is npm not liking a package being placed in a subfolder of a git repository, instead https://gitpkg.now.sh/janvanbouwel/libzt/src/bindings/nodejs?node-test-release can be used. I've made an example project at https://github.com/janvanbouwel/libzt-node-example that demonstrates this.The text was updated successfully, but these errors were encountered: