Skip to content

Commit 8da91ee

Browse files
committed
initial boilerplate config
0 parents  commit 8da91ee

File tree

8 files changed

+117
-0
lines changed

8 files changed

+117
-0
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.rs]
15+
indent_style = space
16+
indent_size = 4
17+
18+
[*.toml]
19+
indent_style = space
20+
indent_size = 4

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
node_modules
2+
meta.json
3+
4+
# Logs
5+
logs
6+
*.log
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
13+
# Directory for instrumented libs generated by jscoverage/JSCover
14+
lib-cov
15+
16+
# Coverage directory used by tools like istanbul
17+
coverage
18+
19+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
20+
.grunt
21+
22+
# node-waf configuration
23+
.lock-wscript
24+
25+
# Compiled binary addons (http://nodejs.org/api/addons.html)
26+
build/Release
27+
.eslintcache
28+
29+
# Dependency directory
30+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
31+
node_modules
32+
33+
# OSX
34+
.DS_Store
35+
36+
.idea
37+
npm-debug.log.*
38+
target
39+
index.node
40+
artifacts.json
41+
package-lock.json

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# sqlite
2+
3+

lib/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
var addon = require('../native');
2+
3+
console.log(addon.hello());

native/Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[package]
2+
name = "sqlite"
3+
version = "0.1.0"
4+
authors = ["Amila Welihinda <[email protected]>"]
5+
license = "MIT"
6+
build = "build.rs"
7+
exclude = ["artifacts.json", "index.node"]
8+
9+
[lib]
10+
name = "sqlite"
11+
crate-type = ["dylib"]
12+
13+
[build-dependencies]
14+
neon-build = "0.2.0"
15+
16+
[dependencies]
17+
neon = "0.2.0"

native/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extern crate neon_build;
2+
3+
fn main() {
4+
neon_build::setup(); // must be called in build.rs
5+
6+
// add project-specific build logic here...
7+
}

native/src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#[macro_use]
2+
extern crate neon;
3+
4+
use neon::prelude::*;
5+
6+
fn hello(mut cx: FunctionContext) -> JsResult<JsString> {
7+
Ok(cx.string("hello node"))
8+
}
9+
10+
register_module!(mut cx, {
11+
cx.export_function("hello", hello)
12+
});

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "sqlite",
3+
"version": "0.1.0",
4+
"description": "",
5+
"main": "lib/index.js",
6+
"author": "Amila Welihinda <[email protected]>",
7+
"license": "MIT",
8+
"dependencies": {
9+
"neon-cli": "^0.2.0"
10+
},
11+
"scripts": {
12+
"install": "neon build"
13+
}
14+
}

0 commit comments

Comments
 (0)