Skip to content

jupp0r/node-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node-API Build Status

Using this crate, you'll be easily able to write native node modules in Rust!

Design

I opted for using the new stable, vm-agnostic node api. It is still in an experimental stage and will probably change quite a bit. However, there are plenty of good reasons for using it:

  • it's a plain C api, making the creation of Rust bindings a breeze
  • once it's stable, ABI compatibility between node versions will make life for module maintainers easy
  • the VM agnostic nature of the API enables use on more platforms (ChakraCore, SpiderMonkey)

Furthermore, this crate will make writing asynchronous modules much easier. Due to the nature of NodeJS' event loop, there is almost no point in providing synchronous native modules. Native modules either do

  • compute-intensive work, in which case operations have to be performed in their own thread
  • operations involving IO

In both cases, it's undesirable to block the node event loop. Unfortunately, that's what most binding generators focus on. This crate uses futures-rs to make writing asynchronous modules for compute or IO tasks much easier.

Usage

This is a cargo workspace. Simply run cargo build --all

Status

pre-alpha, some parts work in a proof-of-concept way, but the crate cannot be consumed yet.

License

MIT

About

[pre-alpha] Create asynchronous NodeJS modules with rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published