1.0.2 • Published 2 years ago

@0xcarbon/dkls23-wasm v1.0.2

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

DKLs23-wasm

Wasm bindings for DKLs23.

Instructions for running locally

How to compile to web

  1. Compile the library using wasm:
wasm-pack build --target web

This command will generate a pkg folder in the root of the project.

  1. Enter the pkg folder and generate a symbolic link:
cd pkg && yarn link

This command will make a dkls23-wasm package available to use.

Example usage in a web project

  1. In a web project where you want to use the dkls23-wasm package, 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.

  1. 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

  1. Compile the package:
wasm-pack build --target web --scope 0xCarbon
  1. 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"
  }
}
  1. Login to npm github registry:
npm login --scope=@0xcarbon --registry=https://npm.pkg.github.com
  1. Enter the pkg folder and publish a new release:
cd pkg && npm publish --access restricted
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago