Skip to content
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

JS namespaces (modules) #185

Open
DmitryAstafyev opened this issue Apr 11, 2022 · 1 comment
Open

JS namespaces (modules) #185

DmitryAstafyev opened this issue Apr 11, 2022 · 1 comment

Comments

@DmitryAstafyev
Copy link
Contributor

Hello,
Is it possible to define somehow module/namespace on JS level?
Let's say I have:

mod features {
    #[node_bindgen]
    pub fn feature_a() -> Result<...> { .... }
}

mod tools {
    #[node_bindgen]
    pub fn tool_a() -> Result<...> { .... }
}

On js level I would like to see it as:

let rustcore = require('rustcore.node');
rustcore.features.feature_a();
rustcore.tools.tool_a();

Sorry if question is trivial, but didn't find any kind of solution for that.

@sehz
Copy link
Collaborator

sehz commented Apr 13, 2022

Sorry, not yet. Would love contribution though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants