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

wasm-feature-detect

Package Overview
Dependencies
Maintainers
3
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wasm-feature-detect

A small library to detect which features of WebAssembly are supported in your current browser.

  • 1.6.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
153K
decreased by-18.98%
Maintainers
3
Weekly downloads
 
Created

What is wasm-feature-detect?

The wasm-feature-detect npm package is designed to help developers detect the availability of various WebAssembly (Wasm) features in the user's environment. This can be particularly useful for ensuring compatibility and optimizing performance by leveraging specific Wasm capabilities when they are available.

What are wasm-feature-detect's main functionalities?

Detect SIMD Support

This feature allows you to detect if SIMD (Single Instruction, Multiple Data) is supported in the user's environment. SIMD can significantly improve performance for certain types of computations.

const wasmFeatureDetect = require('wasm-feature-detect');

wasmFeatureDetect.simd().then(supported => {
  if (supported) {
    console.log('SIMD is supported');
  } else {
    console.log('SIMD is not supported');
  }
});

Detect Bulk Memory Operations Support

This feature checks if bulk memory operations are supported. Bulk memory operations can be used to efficiently manage memory in WebAssembly.

const wasmFeatureDetect = require('wasm-feature-detect');

wasmFeatureDetect.bulkMemory().then(supported => {
  if (supported) {
    console.log('Bulk Memory Operations are supported');
  } else {
    console.log('Bulk Memory Operations are not supported');
  }
});

Detect Multi-Value Support

This feature detects if the multi-value extension is supported. Multi-value allows WebAssembly functions to return multiple values, which can simplify certain programming patterns.

const wasmFeatureDetect = require('wasm-feature-detect');

wasmFeatureDetect.multiValue().then(supported => {
  if (supported) {
    console.log('Multi-Value is supported');
  } else {
    console.log('Multi-Value is not supported');
  }
});

Other packages similar to wasm-feature-detect

FAQs

Package last updated on 27 Oct 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