Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hpcc-js/wasm

Package Overview
Dependencies
Maintainers
1
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hpcc-js/wasm

hpcc-js - WASM Libraries

  • 2.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.4K
decreased by-77.79%
Maintainers
1
Weekly downloads
 
Created
Source

@hpcc-js/wasm - Version 2

Tests

@hpcc-js/wasm is now an ESM by default package - this is a good thing, but does require some breaking changes.

This repository contains a collection of useful c++ libraries compiled to WASM for (re)use in Node JS, Web Browsers and JavaScript Libraries:

  • base91 - v0.6.0
  • expat - v2.4.9
  • graphviz - v7.0.1
  • zstd - v1.5.2
  • ...more to follow...

Built with:

Homepage and Documents

Quick Migration Example

v1.x.x

import { graphviz, wasmFolder } from "@hpcc-js/wasm";

wasmFolder("https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist");

const dot = "digraph G { Hello -> World }";

graphviz.dot(dot).then(svg => {
    const div = document.getElementById("placeholder");
    div.innerHTML = svg;    
});

graphvizVersion.then(version => console.log(version));

v2.x.x

import { Graphviz } from "@hpcc-js/wasm/graphviz";

const graphviz = await Graphviz.load();

const dot = "digraph G { Hello -> World }";
const svg = graphviz.dot(dot);
console.log(graphviz.version());

Notes:

  • Import must specify which wasm library your using
  • wasmFolder is no longer needed
  • All wasm libraries have the same asynchronous load pattern
    • const instance = await Wasm.load();

⚠⚠⚠ TypeScript Notes ⚠⚠⚠

When importing an ESM package AND referencing explicit exports (like @hpcc-js/wasm/graphviz or @hpcc-js/wasm/expat), you should change the following tsconfig.json setting:

  • moduleResolution: Node16

This will ensure the correct "types" are auto discovered.

Keywords

FAQs

Package last updated on 13 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc