An exact-arithmetic stoichiometric equation balancer for JavaScript and TypeScript available as an npm package for both CJS and ESM imports.
https://richie-rich90454.github.io/fast-balance/ โ HEALTH ? 70 / Stable
An exact-arithmetic stoichiometric equation balancer for JavaScript and TypeScript available as an npm package for both CJS and ESM imports.
https://richie-rich90454.github.io/fast-balance/ โ// readme
Exact, fast stoichiometric equation balancing for JavaScript and TypeScript.
Conservation of mass and charge are solved with BigInt rational arithmetic โ no floating-point discrepancy, ever.
O(mยฒยทn) with m = O(1): linear in the number of species.()/[], ionic charges, hydrates, state symbols, isotopes, nuclear mode, functional groups and common abbreviations.C3H8 + O2 + N2 -> CO2 + H2O + N2).balanceAll returns every independent balance.BalanceError with stable codes; unknown elements, ambiguous input and unbalanceable equations are reported explicitly."sideEffects": false soโฆ