Skip to content

Releases: pocketrocket/floatify

v2.0.0 — modern ESM-only rewrite

02 Jun 21:04
v2.0.0
76345f9

Choose a tag to compare

First major in years: a from-scratch modernization of floatify with zero runtime dependencies.

⚠️ Breaking changes

  • ESM-only. floatify is now a native ES module (export default). Use import floatify from "floatify"; require() is no longer supported (CJS consumers on Node ≥ 22.12 can use require(esm)).
  • Node ≥ 18 required.

What's changed

  • Rewritten in modern ES6+ (no Babel — Node runs it natively). The parsing algorithm is unchanged; all 281 test assertions pass.
  • Test suite migrated to the built-in node:test runner — mocha + c8 removed, which also clears the serialize-javascript (RCE) and diff (DoS) advisories at the root. npm audit0 vulnerabilities.
  • eslint flat config; dropped legacy Babel/airbnb-es5/Travis/Scrutinizer setup.
  • Published tarball scoped to src/ only.

Usage

import floatify from "floatify";

floatify("123.242,5346556"); //=> 123242.5346556
floatify("123.123", true);   //=> 123.123 (prefer decimal separator)

npm: https://www.npmjs.com/package/floatify