---
title: "Intro to Wasm in Deno"
description: "Deno 2.1 lets Wasm modules be imported directly like JavaScript modules, with their exports understood and typechecked."
url: "https://swe.quest/articles/intro-to-wasm-in-deno-e9e470adfcfab289"
canonical: "https://deno.com/blog/intro-to-wasm"
source: "Deno"
published: "2025-01-28"
difficulty: "medium"
kind: "How-to"
reading_minutes: 4
tags: ["webassembly","rust","javascript"]
---

# Intro to Wasm in Deno

A post on [Deno](https://swe.quest/sources/deno.md), published 2025-01-28, 4 min read, How-to. Original: [https://deno.com/blog/intro-to-wasm](https://deno.com/blog/intro-to-wasm)

## Summary

Deno 2.1 lets Wasm modules be imported directly like JavaScript modules, with their exports understood and typechecked. A hand-written WAT \`add\` function is compiled with wat2wasm and imported into Deno. The second example uses the wasmbuild CLI, which wraps wasm-bindgen, to scaffold a Rust crate and generate JS glue, .d.ts types and a .wasm binary, so Rust functions and structs can be called from JavaScript. Production use typically compiles Wasm from Rust, C++ or Go rather than writing WAT by hand.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [WebAssembly](https://swe.quest/tags/webassembly.md) (Languages)
- [Rust](https://swe.quest/tags/rust.md) (Languages)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)

## Prerequisites

- JavaScript modules ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- basic Rust ([easy posts on Rust](https://swe.quest/tags/rust.md?difficulty=easy))

## Keywords

Deno, WebAssembly, wasmbuild, wasm-bindgen, wat2wasm, Deno 2.1

## Related posts

- [wasmbuild - Using Rust in Deno and Web Apps](https://swe.quest/articles/wasmbuild-using-rust-in-deno-and-web-apps-ea6b475b6d77519e.md): Deno · 2022-06-30 · Medium · 3 min read · WebAssembly, Rust, JavaScript, Build systems
  wasmbuild is a Deno-run CLI script that compiles Rust crates to WebAssembly via wasm-bindgen, generates JavaScript glue code with multiple loader strategies and lazy instantiation, and optimizes output with wasm-opt.
- [Deno 2.1: Wasm Imports and other enhancements](https://swe.quest/articles/deno-2-1-wasm-imports-and-other-enhancements-af4c182924b76014.md): Deno · 2024-11-21 · Medium · 17 min read · JavaScript, WebAssembly, Runtimes & VMs, Developer tools, Build systems
  Deno 2.1 lets Wasm modules be imported directly as ES modules.
- [Roll your own JavaScript runtime, pt. 2](https://swe.quest/articles/roll-your-own-javascript-runtime-pt-2-53cebea56dc325e0.md): Deno · 2023-02-15 · Medium · 7 min read · Runtimes & VMs, Rust, JavaScript, TypeScript
  A custom JavaScript runtime built on deno\_core gains three capabilities: a fetch op backed by the reqwest crate and registered in the runjs extension, a CLI that takes the script path as its first argument, and TypeScript/TSX support.
- [Deno's Other Open Source Projects](https://swe.quest/articles/deno-s-other-open-source-projects-d23e8b3569399530.md): Deno · 2025-10-16 · Easy · 7 min read · Open source, Rust, Runtimes & VMs, JavaScript, Developer tools
  Deno publishes many MIT-licensed supporting libraries extracted from its runtime, most of them Rust crates.
- [Life of a Zed Extension: Rust, WIT, Wasm](https://swe.quest/articles/life-of-a-zed-extension-rust-wit-wasm-ec148b04db708b5a.md): Zed · 2024-10-21 · Medium · 21 min read · WebAssembly, Rust, Developer tools
  Zed extensions are written in Rust but never compiled on the user's machine.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
