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

parcel-plugin-wasm.rs

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parcel-plugin-wasm.rs

wasm-bindgen support for Parcel bundler

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

parcel-plugin-wasm.rs

wasm-bindgen support for Parcel bundler

Requirements

  • cargo
  • wasm-pack

Installation

npm i --save-dev parcel-plugin-wasm.rs

Usage

extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;

#[wasm_bindgen]
pub fn foo(x: &str) -> String {
  if x == "abc" {
    "yes".to_string()
  } else {
    "no".to_string()
  }
}
import { foo } from 'path/to/Cargo.toml'

console.log(foo('abc'))    // yes
import lib from 'path/to/Cargo.toml'

console.log(lib.wasm)    // original wasm import data
console.log(lib.wasm.memory)    // memory data

With Profile

You can use the cli variable WASM_PACK_PROFILE={profile} to change the profile used by wasm-pack build.

For example: WASM_PACK_PROFILE=dev parcel src/index.html

The profile list is according to https://rustwasm.github.io/wasm-pack/book/commands/build.html#profile.

FAQs

Package last updated on 08 Dec 2020

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