Installation
Install the LOESS library for your preferred language.
From NPM (recommended)
Section titled “From NPM (recommended)”npm install fastloess-wasmFrom CDN
Section titled “From CDN”<script type="module"> import init, { Loess } from "https://cdn.jsdelivr.net/npm/fastloess-wasm@0.9/fastloess_wasm.js"; await init();</script>From Source
Section titled “From Source”# Install Rust first: https://rustup.rs/# Install wasm-pack: https://rustwasm.github.io/wasm-pack/installer/git clone https://github.com/thisisamirv/loess-projectcd loess-project/bindings/wasm# For bundlers (Webpack, Vite, etc.)wasm-pack build --target bundler# For Node.jswasm-pack build --target nodejs# For browser (no bundler)wasm-pack build --target webCheck the Package Version
Section titled “Check the Package Version”For a Node.js build (wasm-pack build --target nodejs):
const { version } = require('fastloess-wasm');console.log(version());3.0.0For a browser build (--target web), initialize WebAssembly first:
import init, { version } from 'fastloess-wasm';
await init();console.log(version());This reports the WASM binding package version.
Verify Installation
Section titled “Verify Installation”const { Loess } = require('fastloess-wasm');
const x = new Float64Array([1.0, 2.0, 3.0]);const y = new Float64Array([2.0, 4.0, 6.0]);const model = new Loess({});const result = model.fit(x, y);console.log("Installed successfully!");Installed successfully!