npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hskang9/what_is_wasm

v0.1.7

Published

![webassembly](https://upload.wikimedia.org/wikipedia/commons/thumb/c/c6/Web_Assembly_Logo.svg/1200px-Web_Assembly_Logo.svg.png)

Readme

Topic 2-1. What is WebAssembly(WASM)?

webassembly

WebAssembly is a new assembly language close to metal which is shared all types of major browsers.

It started as an upgrade to javascript, which is the only programming language on the web browser to be compiled on native level. However, all programming languages now try to support it to be compiled in the assembly language so that they can be compiled to the web without using javascript.

Rust is one of them but has more advantages than other languages with its memory-safe compiler without garbage collection. Compiled wasm from Rust has less wasm code and memory-safe on development.

To witness the power of WebAssembly in rust, check out

awesome-wasm

How to use wasm in rust

In this topic, we will make node package with wasm.

  • Set nightly version as default
rustup default nightly
  • Start new rust project with Cargo new wasm-tutorial

  • Set Cargo.toml as below:

[package]
name = "wasm-tutorial"
version = "0.1.0"
authors = ["hskang9 <[email protected]>"]
edition = "2018"


[lib]
crate-type = ["cdylib"] // only static library is supported on wasm for now


[dependencies]
wasm-bindgen="0.2"

Bind wasm code to javascript

Building Javascript wrapper interface

To enable the functions created from the rust on browser, we need to build a wrapper interface to be run on js file. You can think of this as importing javascript function to rust file.

extern create wasm_bindgen;
use wasm_bindgen::prelude::*;

// Wrapper interface
#[wasm_bindgen]
extern {
    fn alert(s: &str);
}

Producing Rust functions that Javascript can call

With wasm-bindgen, you can also export rust code with javascript functions.

#[wasm_bindgen]
pub fn hello_world(name: &str) {
    alert(&format!("Hello, {}!", name));
}

Building wasm into node package that can be published

Now javascript is a compiled language with the wasm. build the package by running this command.

wasm-pack build 

Then go to pkg folder and you can use npm commands for this.

cd pkg/

npm publish --access=public