flips-wasm

0.0.2 • Public • Published

Floating IPS in Wasm

This is a WebAssembly version of Alcaro's excellent Floating IPS created with Emscripten for use in JavaScript projects.

Installation

npm install flips-wasm

Or using Yarn:

yarn add flips-wasm

Usage

In Node.js:

const {
  bpsCreate,
  bpsApply,
  ipsCreate,
  ipsApply,
  upsCreate,
  upsApply,
} = require('flips-wasm');

In ES6:

import {
  bpsCreate,
  bpsApply,
  ipsCreate,
  ipsApply,
  upsCreate,
  upsApply,
} from 'flips-wasm';

The Wasm modules are loaded asynchronously, so you may want to use the corresponding Promise versions of the functions in your code. The Promise resolves with the result of the Flips function.

import { bpsCreatePromise } from 'flips-wasm';

bpsCreatePromise(sourceFile, targetFile).then(patchFile => {
  // ...write to file
});

Building

You probably don't need to build this, but I'll tell you how to anyway.

First, make sure you have Emscripten installed so you can use the emcc command.

npm run build

This will create various js and wasm files in the lib/ directory.

Acknowledgements

Package Sidebar

Install

npm i flips-wasm

Weekly Downloads

0

Version

0.0.2

License

ISC

Unpacked Size

313 kB

Total Files

13

Last publish

Collaborators

  • kmck