Skip to content

Instantly share code, notes, and snippets.

@mizdra
Last active March 9, 2018 06:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mizdra/e71b62f0ee839c8ad58ef679f2db747b to your computer and use it in GitHub Desktop.
Save mizdra/e71b62f0ee839c8ad58ef679f2db747b to your computer and use it in GitHub Desktop.
import { add } from './math.rs'
console.log(add(1, 2))
#[no_mangle]
pub fn add(a: i32, b: i32) -> i32 {
a + b
}
{
"name": "parcel-wasm-for-node",
"version": "0.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"build": "parcel build -t node -o dist/bundle.js index.js",
"start": "node dist/bundle.js",
"prestart": "npm run build"
},
"devDependencies": {
"parcel-bundler": "^1.6.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment