npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fhss-web-team/fuzzy-dates

v1.2.2

Published

Parses imprecise date strings into a structured form that can be normalized, indexed, searched, and ordered while preserving the original input.

Readme

Fuzzy Dates

Parse imprecise, human-entered date strings into a structured, consistent model that you can normalize, search, sort, and serialize.

Explore the docs

Features

  • Handles modifiers like before, after, about, between, from, early, mid, late.
  • Normalizes many input shapes (1st of February 1900, Feb 1 1900, winter 1890, 1800s).
  • Produces inclusive lower/upper bounds for range filtering and a collation key for stable chronological sorting.
  • Outputs a canonical JSON model plus GEDCOM X formal dates for genealogy interoperability.
  • ESM + TypeScript ready (.d.ts shipped with the package).

Installation

npm i @fhss-web-team/fuzzy-dates

Quick start

import { FuzzyDate } from "@fhss-web-team/fuzzy-dates";

const parsed = FuzzyDate.parse("about Feb 1900");
if (!parsed.ok) throw parsed.error;

const date = parsed.value;
console.log(date.normalized); // "about 1 February 1900"
console.log(date.lowerBound); // 1899-02-01T00:00:00.000Z (Date)
console.log(date.upperBound); // 1901-01-31T23:59:59.999Z (Date)
console.log(date.collationKey); // deterministic string for sorting

// Serialize for storage and hydrate later
const json = date.toJSON();
const hydrated = FuzzyDate.fromJSON(json);

API snapshot

  • FuzzyDate.parse(input: string): Result<FuzzyDate, string> — non-throwing parse; errors come back as { ok: false, error }.
  • FuzzyDate.fromJSON(model: FuzzyDateModel) — rebuild from the canonical JSON model.
  • FuzzyDate instance properties:
    • normalized — normalized human-readable string.
    • lowerBound / upperBound — inclusive Date bounds (or null for unbounded).
    • collationKey — sortable string aligned to chronological order.
    • formal — GEDCOM X formal date representation.
    • toJSON() — returns the canonical model.

Development

  • Tests: npm test (Vitest)
  • Build: npm run build (TypeScript -> dist/)
  • Pack locally (publish dry-run): npm pack then install the generated .tgz in a temp project to verify exports and typings.

Support

This package was developed by the BYU's Center for Family History and Genealogy. To support our mission to provide quality online family history research and resources for the public at no cost, consider donating HERE

License

MIT © FHSS Web Team