README.md

August 26, 2021 ยท View on GitHub

wasm-calculator

Web Assembly Calculator POC wasm-pack.

About

This poc is designed for creating a Calculator app in Web Assembly and Rust

Requirements

Befor start with this poc You need to install Rust, Node

๐Ÿšด Usage

๐Ÿ‘ Use cargo generate to Clone this Template

Learn more about cargo generate here.

cargo generate --git https://github.com/rustwasm/wasm-pack-template.git --name wasm-calculator
cd wasm-calculator

๐Ÿ› ๏ธ Build with wasm-pack build

wasm-pack build

๐Ÿ”ฌ Test in Headless Browsers with wasm-pack test

wasm-pack test --headless --firefox

๐ŸŽ Publish to NPM with wasm-pack publish

wasm-pack publish

๐Ÿ”‹ Batteries Included

Directory Structure

  src/       under this dir we have lib.rs file where we write all functions required for calculator
  test/      under this dir we write all test cases for all calculator operations
  www/       under this folder we write javascript code (UI part of wasm-calculator)