Skip to content

Latest commit

 

History

History
43 lines (25 loc) · 1.02 KB

README.md

File metadata and controls

43 lines (25 loc) · 1.02 KB

rust-wasm-mandelbrot

Draw the Mandelbrot fractal using Rust compiled to WebAssembly!

Requirements

Running This Project

First, make sure all your dependencies are installed and at the correct version.

Then, clone this repository:

$ git clone https://github.com/s3thi/rust-wasm-mandelbrot

Build the WASM module using wasm-pack:

$ cd rust-wasm-mandelbrot/
$ wasm-pack build

The generated WASM module, along with some glue JavaScript code and TypeScript type definitions, will be placed in the pkg/ directory. Make it available as an NPM module:

$ cd pkg/
$ npm link

Then, go into the www/ directory and install all the Node dependencies:

$ cd ../www/
$ npm i

Link the NPM package containing the WASM module:

$ npm link rust-wasm-mandelbrot

Run the project:

$ npm start

If everything went well, going to http://localhost:8080 should give you an image of the Mandelbrot fractal!