@0xcarbon/dkls23-wasm
v1.0.2
Published
Wasm bindings for [DKLs23](https://github.com/0xCarbon/DKLs23).
Keywords
Readme
DKLs23-wasm
Wasm bindings for DKLs23.
Instructions for running locally
How to compile to web
- Compile the library using wasm:
wasm-pack build --target webThis command will generate a pkg folder in the root of the project.
- Enter the
pkgfolder and generate a symbolic link:
cd pkg && yarn linkThis command will make a dkls23-wasm package available to use.
Example usage in a web project
- In a web project where you want to use the
dkls23-wasmpackage, bind the the symbolic link to the project:
yarn link "dkls23-wasm"This command will add the dkls23-wasm package to the project node_modules.
- Initialize the wasm module and make use of the package:
import init, { greet } from 'dkls23-wasm';
init().then(() => {
greet();
});Instructions for making a new release
- Compile the package:
wasm-pack build --target web --scope 0xCarbon- Update the package.json version, repository and publishConfig. It should look something like this:
{
"name": "@0xCarbon/dkls23-wasm",
"version": "0.1.0",
"repository": "https://github.com/0xCarbon/dkls23-wasm",
"files": [
"dkls23_wasm_bg.wasm",
"dkls23_wasm.js",
"dkls23_wasm.d.ts"
],
"module": "dkls23_wasm.js",
"types": "dkls23_wasm.d.ts",
"sideEffects": false,
"publishConfig": {
"registry": "https://npm.pkg.github.com"
}
}- Login to npm github registry:
npm login --scope=@0xcarbon --registry=https://npm.pkg.github.com- Enter the
pkgfolder and publish a new release:
cd pkg && npm publish --access restricted