๐Ÿ“ฆ jordojordo / wasm-prime

WASM in the browser to check if a number is prime.

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching
wasmwebassembly
๐Ÿ“ฅ Clone https://github.com/jordojordo/wasm-prime.git
HTTPS git clone https://github.com/jordojordo/wasm-prime.git
SSH git clone git@github.com:jordojordo/wasm-prime.git
CLI gh repo clone jordojordo/wasm-prime
Jordon Leach Jordon Leach Install pnpm manually bb25dcd 11 months ago ๐Ÿ“ History
๐Ÿ“‚ bb25dcdc24ddbb061b7b92d55e19b8d8a9a1a0b0 View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ assembly
๐Ÿ“ tests
๐Ÿ“„ .gitignore
๐Ÿ“„ asconfig.json
๐Ÿ“„ index.html
๐Ÿ“„ package.json
๐Ÿ“„ pnpm-lock.yaml
๐Ÿ“„ README.md
๐Ÿ“„ README.md

WASM Prime Checker

This project demonstrates how to use AssemblyScript to compile WebAssembly (WASM) and interact with JavaScript in the browser. It includes a simple prime number checker that determines whether a given number is prime.

See it in action: https://jordojordo.github.io/wasm-prime

Prerequisites

Ensure you have the following installed:

Running Locally

  • Clone the repository:
git clone https://github.com/jordojordo/wasm-prime.git
   cd wasm-prime
  • Install dependencies:
pnpm install
  • Open in browser
Navigate to http://localhost:8080

Build

Compile the AssemblyScript into a WASM module:
pnpm asbuild
This generates:
build/release.wasm

Test

Run unit tests for the WebAssembly module:
pnpm test