0.1.3 • Published 2 years ago

firnas_wasm v0.1.3

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Firnas WASM

WebAssembly bindings for Firnas.

Why?

Browsers are different systems, so they should be treated differently. For example, browsers doesn't have standard IO, so firnas abstracts the stdio then firnas_wasm provides a custom implementation and expose callbacks.

How to use?

npm i firnas_wasm
# or
yarn install firnas_wasm
import init, { compile } from 'firnas_wasm';

init()
    .then(() => {
        let results = [];
        let isLoading = false;
        compile(
            /* code */ code,
            /* on print */ (res) => { results.push(res) },
            /* on start compilation */ () => { isLoading = true; },
            /* on finish execution */ () => {
                console.log(results.join("\n"));
                isLoading = false;
            }
        );
    });
0.1.2

2 years ago

0.1.1

2 years ago

0.1.3

2 years ago

0.1.0

2 years ago