# pwagle-wasm

> hpcc-js - WASM Libraries

Latest version **2.3.0** (published 2022-12-19) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install pwagle-wasm
pnpm add pwagle-wasm
yarn add pwagle-wasm
bun add pwagle-wasm
```

Provides the command `dot-wasm`.

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2022-12-19 |
| First published | 2022-12-19 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Gordon Smith |
| Maintainers | pwagle |
| Keywords | graphviz, typescript, webassembly, wasm, dot, zstd, graphviz-dot, zstandard, expat, base91, expat-xml-parser, webassemby |

## Links

- npm: https://www.npmjs.com/package/pwagle-wasm
- Repository: https://github.com/wagle/hpcc-js-wasm
- Homepage: https://wagle.github.io/hpcc-js-wasm/
- Issues: https://github.com/wagle/hpcc-js-wasm/issues
- npm.io page: https://npm.io/package/pwagle-wasm

## Dependencies (1)

- [yargs](https://npm.io/package/yargs.md) 17.6.2

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.3.0 (latest) — 2022-12-19

## README

# @hpcc-js/wasm - Version 2

![Tests](https://github.com/hpcc-systems/hpcc-js-wasm/workflows/Test%20PR/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/GordonSmith/hpcc-js-wasm/badge.svg?branch=BUMP_VERSIONS)](https://coveralls.io/github/GordonSmith/hpcc-js-wasm?branch=BUMP_VERSIONS)

**@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](https://base91.sourceforge.net/) - v0.6.0
- [expat](https://libexpat.github.io/) - v2.5.0
- [graphviz](https://www.graphviz.org/) - v7.0.4
- [zstd](https://github.com/facebook/zstd) - v1.5.2
- ...more to follow...

Built with:
- [emsdk](https://github.com/emscripten-core/emsdk) - v3.1.27

## Homepage and Documents

* [Homepage](https://hpcc-systems.github.io/hpcc-js-wasm/)
    * [Base91](https://hpcc-systems.github.io/hpcc-js-wasm/classes/base91.Base91.html)
    * [Expat](https://hpcc-systems.github.io/hpcc-js-wasm/classes/expat.Expat.html)
    * [Graphviz](https://hpcc-systems.github.io/hpcc-js-wasm/classes/base91.Base91.html)
    * [Zstd](https://hpcc-systems.github.io/hpcc-js-wasm/classes/zstd.Zstd.html)

## Quick Migration Example

v1.x.x
```ts
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
```ts
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.

---
_Source: https://npm.io/package/pwagle-wasm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
