Skip to main content
Sign in
Snippets Groups Projects
Commit d7e0577f authored by nanocryk's avatar nanocryk
Browse files

Neon setup

parent d7142366
Branches
Tags
No related merge requests found
# Generated by Cargo native/target
# will have compiled files and executables native/index.node
/target/ native/artifacts.json
**/*~
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries **/node_modules
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock **/.DS_Store
Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk
var addon = require('../native');
console.log(addon.hello());
[package]
name = "duniter-rs-wotb-js"
version = "0.0.0"
authors = ["nanocryk <nanocryk@gmail.com>"]
license = "GPL-3.0"
build = "build.rs"
[lib]
name = "duniter_rs_wotb_js"
crate-type = ["dylib"]
[build-dependencies]
neon-build = "0.1.20"
[dependencies]
neon = "0.1.20"
extern crate neon_build;
fn main() {
neon_build::setup(); // must be called in build.rs
// add project-specific build logic here...
}
#[macro_use]
extern crate neon;
use neon::vm::{Call, JsResult};
use neon::js::JsString;
fn hello(call: Call) -> JsResult<JsString> {
let scope = call.scope;
Ok(JsString::new(scope, "hello node").unwrap())
}
register_module!(m, {
m.export("hello", hello)
});
{
"name": "duniter-rs-wotb-js",
"version": "0.0.0",
"description": "Javascript wrapper of duniter-rs-wotb for future usage in duniter-ts.",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "https://github.com/duniter-rs/duniter-rs-wotb-js.git"
},
"author": "nanocryk <nanocryk@gmail.com>",
"license": "GPL-3.0",
"dependencies": {
"neon-cli": "^0.1.20"
},
"scripts": {
"install": "neon build"
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment