New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@polywrap/asyncify-js

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polywrap/asyncify-js

Async Wasm Imports Support Using Asyncify

  • 0.12.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
102
increased by61.9%
Maintainers
2
Weekly downloads
 
Created
Source

@polywrap/asyncify-js

A 0 dependency wrapper around the Node.JS & Browser WebAssembly instance, which adds support for asyncify, enabling the use of async host import functions.

Usage

import { AsyncWasmInstance } from "@polywrap/asyncify-js";

// module.wasm must be asyncify enabled
const module: ArrayBuffer = getModule("./module.wasm");
const memory = new WebAssembly.Memory({ initial: 1 });

const instance = await AsyncWasmInstance.createInstance({
  module,
  imports: {
    my: {
      custom_import: async (arg: number): Promise<number> => {
        return await someAsyncCall(arg);
      }
    },
    env: {
      memory
    }
  }
});

await instance.exports.main();

FAQs

Package last updated on 21 Aug 2023

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