Counting from a CommonJS project no longer needs a dynamic import: the package
answers require() as well, on the versions of Node that load ESM from it.
Added
- A CommonJS project can
require('faircount'). There is no CommonJS build: the
exports map answers therequirecondition with the same ESM file, which Node
reads fromrequire()on the versions below.
Changed
- Requires Node
^20.19.0 || >=22.12.0, the versions that load ESM from
require()without a flag. A single floor would have promised 22.0 through
22.11, where the feature sits behind a flag. Below the rangeimportstill
works, but it is no longer covered.
Fixed
- A fractional
seedis refused instead of seeding the run of its floor:1.5
and1produced the same sequence, while the README and the types promised an
integer.
The README now compares faircount with HyperLogLog, says that two estimators
never combine into one count, and gives what the sample weighs in bytes.