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

wasm-persist

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wasm-persist

a JS module for creating orthogonal persistent WebAssembly instances

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

SYNOPSIS

NPM Package Build Status Coverage Status

js-standard-style

This allows you to hibernate a WebAssembly instance and later start it up again at the exact place you left off.

INSTALL

npm install wasm-persist

USAGE

const persist = require('wasm-persist')
...
wasm = persist.prepare(wasm)
const {instance} = await WebAssembly.instantiate(wasm)
// call some exported functions on your instance
// then when you are done
const state = persist.hibernate(instance)

...

// later you can revive the wasm instance
const {instance} = await WebAssembly.instantiate(wasm)
// just call persist.resume with the old state
persist.resume(instance, state)

DESCRIPTION

The Idea for wasm-persist came from orthogonal persistence. wasm-persist injects getter and setter function for each global and exports the memory and table if they exist. Hibernate calls the getters and creates an Object that contains the memory (as a typedArray), the globals, and the function table. Resume does the opposite and calls the setters for the globals and updates the memory and the table. Foreign functions on the table are not handled currently.

API

./docs/

LICENSE

MPL-2.0

Keywords

FAQs

Package last updated on 26 Apr 2018

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