Node.js Addon for the safe_app crate
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
native
.gitignore
.npmrc
README.md
index.js
package.json

README.md

safe_app_node

Requirements

Neon is used to compile, installed via NPM:

npm install -g neon-cli

Building

npm install

Arch Linux and possibly other OSes (2019-01-13)

Compiling this library might yield an error about telling to 'recompile with -fPIC'. This happens on Arch Linux, but might happen on other systems too. The solution is to clean and run again with specifying an environment variable:

> neon clean                            # This also cleans Cargo
> RUST_SODIUM_DISABLE_PIE=1 neon build  # Build libsodium differently

Example

const safe = require('safe_app_node');

safe.app_is_mock(); // returns boolean

Type conversions

JavaScript Rust FFI (C ABI)
String String *const c_char
ArrayBuffer *mut T *mut T