0.3.1 • Published 5 years ago
dup-tools-wasm v0.3.1
DUP Tools
A tools box lib for DUP (Dividend Universal Protocol) in WebAssembly (WASM).
- Rust reliability
- WebAssembly performances
- JavaScript wide usability
You can use DUP tools directly in modern browsers or server side with node.js.
Project state
📝 Usage
Full usage example with online demo
⚡ Quick start guide
- install npm
- Create an empty folder for your project, and open a terminal in it.
To install
dup-tools-wasmrunnpm install dup-tools-wasmcreate a js file
myFirstExperiment.jswith the following code :import * as dup from "dup-tools-wasm"; const keypair = dup.generate_ed25519_keypair("salt", "password"); console.log(keypair);WiP
for in browser use case :create an html file
index.htmlwith the following code :<meta charset="utf-8"/> <h1>See your console result (F12 by default)</h1> <script module src="myFirstExperiment.js"></script>
for node.js use case :
End WiP
Contribute
🔮 Prerequisites
You need wasm-pack and it prerequisites (Rust and npm)
🛠️ Build with wasm-pack build
wasm-pack build🔬 Test in Headless Browsers with wasm-pack test
wasm-pack test --headless --firefox
wasm-pack test --headless --chrome
wasm-pack test --headless --safari🎁 Publish new release to NPM
Before publish, build in release mode without default features :
wasm-pack build --release -- --no-default-featuresYou need npm token, if you don't have, get it with npm login command.
Then publish ( help) :
wasm-pack publish