|
|
|
|
|
by dherman
3830 days ago
|
|
Rust is a compiled language, so the JS files don't directly load a .rs file but instead they load a native Node extension, i.e. a .node file, which is generated by compiling and linking the Rust sources. (The node-cli tooling automates the whole build process.) The line you cited is automatically locating the .node file, loading it, and returning the module object associated with it. On IRC a couple people have been questioning this part of the API, suggesting that just using the standard npm module `bindings` might be better. It's a reasonable idea and I'll probably open a discussion in a GitHub issue. |
|
My question is/was, given two or more modules written in Rust, how do I address and require them by name? Due to its naming I assumed "neon-bridge" would be the glue that handles this. Given the fact that you can require .node files directly, it was not clear to me that "neon-bridge" is just the name of an example module (or is it?).