Structural analysis in JavaScript
A real finite-element solver — 3D beams, frames and trusses, with EN 1993-1-1 steel checks — compiled from Rust to WebAssembly and published on npm. It runs in your users' browsers, so there is no server to operate, no request per solve and no model leaving their machine.
npm install @ferscloud/fers-calculation-webThe whole integration
No initialisation call, no API key, no network. You hand it model JSON and it hands back an envelope you branch on.
import { calculate_from_json } from "@ferscloud/fers-calculation-web";
// A 5 m cantilever, IPE 180 in S235, 1 kN down at the tip.
const res = JSON.parse(calculate_from_json(JSON.stringify(model)));
if (res.ok) {
const dy = res.result.results.loadcases["End Load"]
.displacement_nodes["2"].dy;
console.log(`Tip deflection: ${(dy * 1000).toFixed(3)} mm`);
// Tip deflection: -15.065 mm
// Hand check: PL³/3EI_z = 1000·5³ / (3 · 210e9 · 13.17e-6) = 15.07 mm
} else {
console.error(res.error.code, res.error.message);
}The printed value is the real output for those inputs, and the comment is the closed-form check it agrees with. That habit is worth copying: solve a case you already know before trusting one you do not.
Why put the solver in the browser
Nothing to operate
There is no solver service to deploy, scale, patch or pay for. The computation happens on the device that asked for it, so a page solving ten thousand times a day costs you the same as one solving once.
Fast enough to be live
A typical frame solves in milliseconds with no round-trip, so a slider can re-solve as it moves. Interfaces that would be unusable at network latency become obvious ones.
The model stays put
Geometry never leaves the visitor's machine. When the model is a client's building, not posting it to a third party is a feature you can state plainly.
The loop a web form cannot do
One solve is a calculator. A thousand solves is a search — and once each one is free and instant, sweeping a parameter stops being something you batch overnight and becomes something the page does while someone drags a slider.
import { calculate_from_json } from "@ferscloud/fers-calculation-web";
// Which of these sections keeps the span within its deflection limit?
const limit = span / 300;
for (const section of catalogue) {
const res = JSON.parse(
calculate_from_json(JSON.stringify(buildModel(span, section))),
);
if (!res.ok) continue;
const sag = Math.abs(midspanDeflection(res.result));
if (sag <= limit) {
console.log(section.name, (sag * 1000).toFixed(1), "mm");
}
}
// Runs entirely in the visitor's browser: no request per iteration,
// no rate limit, no per-solve cost.The solver is synchronous and CPU-bound, so for anything substantial run it in a Web Worker and keep the UI thread free.
// solver.worker.ts — keep the UI thread free.
import { calculate_from_json } from "@ferscloud/fers-calculation-web";
self.onmessage = (e: MessageEvent<{ id: number; model: string }>) => {
const out = calculate_from_json(e.data.model);
self.postMessage({ id: e.data.id, out });
};Where it runs
Two packages are published from the same engine with an identical API: @ferscloud/fers-calculation-web for anything behind a bundler, and @ferscloud/fers-calculation for Node. React, Vue, Svelte and plain JavaScript all consume it the same way, and generated TypeScript model types ship alongside.
This is not a demo build. The FERS web app, the 2D frame calculator and every beam calculator on this site run on the same package you would install — so you can see exactly what it does before adding a dependency.
What it costs
Free for models up to 100 members, with no account and no key — that covers most beams, portal frames and small trusses. A short-lived signed token from your server raises the ceiling to 10,000 members. There is no per-solve charge in either case, because there is no server doing the solving.
Not building a front end?
- Structural analysis in Python — the same engine from a script, for anything repetitive or version-controlled.
- REST API — plain HTTP from any language, with an OpenAPI 3.1 spec.
- MCP server — let Claude, ChatGPT, Cursor or VS Code build and check models directly.