npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@spruceid/didkit-wasm-node

v0.2.1

Published

[![](https://img.shields.io/npm/v/@spruceid/didkit-wasm?label=%40spruceid%2Fdidkit-wasm&logo=npm)](https://www.npmjs.com/package/@spruceid/didkit-wasm) [![](https://img.shields.io/npm/v/@spruceid/didkit-wasm-node?label=%40spruceid%2Fdidkit-wasm-node&logo=

Downloads

1,899

Readme

DIDKit WASM

Prerequisites to Build from Source

NPM packages are available but if you would like to compile DIDKit yourself (e.g. to enable different cryptographic backends) you will need the WASM compiler toolchain as well as a specific build tool:

$ rustup target add wasm32-unknown-unknown
$ cargo install wasm-pack
# OR
# $ curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

Installation and Usage

Node

WASM can be used in Node.js (any recent version):

$ npm i @spruceid/didkit-wasm-node

Or build it from source:

$ wasm-pack build --target nodejs

Web Frameworks (Bundled)

WASM can be used with web frameworks and bundlers like Webpack:

$ npm i @spruceid/didkit-wasm

Or build it from source:

$ wasm-pack build

If Webpack doesn't work with the default configuration, you can have a look at our configuration for tzprofiles.

Vanilla Javascript

WASM can be used with plain Javascript with newer browsers. As it cannot be used as a NPM package you have to build it manually:

$ wasm-pack build --target web

The manual tests in test/ serve as an example on how to import DIDKit.

Tests

The test/ directory contains manual tests to run in the browser. Instructions are in the README of the directory.

Non-Default Compilation

The current version of the ring crate does not provide all the symbols needed to run on the browser, see DEPS.md

To compile all features plus wasm32_c on ring, a C compiler is needed, see spruceid/ssi:

On Ubuntu this one option is to install clang and llvm:

sudo apt install clang-10 llvm-10

Then to compile with all features:

TARGET_CC=clang-10 TARGET_AR=llvm-ar-10 wasm-pack build --out-dir pkg

To use a custom subset of features:

wasm-pack build --out-dir pkg -- --no-default-features --features=issue        # issue credential/presentation
wasm-pack build --out-dir pkg -- --no-default-features --features=verify       # verify credential/presentation
wasm-pack build --out-dir pkg -- --no-default-features --features=credential   # issue/verify credential
wasm-pack build --out-dir pkg -- --no-default-features --features=presentation # issue/verify presentation

don't forget to add TARGET_CC and TARGET_AR if using ring with wasm32_c