@lacspace/datecheck
Tell how old an article really is — so an undated 2019 story is never republished as today's news. Extract the published/modified date from HTML (JSON-LD incl. @graph, meta tags, <time>, URL patterns, bylines), including Nepali Bikram Sambat dates (Devanagari digits, every month spelling, BS→AD on a verified table), detect body-text staleness, and return a fresh | stale | unknown verdict. Fail-closed: no date + no signal = unknown, never silently fresh. AI only via an optional injected hook. Zero third-party deps, deterministic, isomorphic.
npm i @lacspace/datecheckUsage
import { extractPublishedDate, assessFreshness, bsToAd } from "@lacspace/datecheck";
extractPublishedDate(html, url).publishedAt; // reads JSON-LD / meta / <time> / URL / byline, incl. Bikram Sambat
assessFreshness({ html, text, url, feedDate, now: new Date(), maxAgeHours: 48 }).verdict; // "fresh" | "stale" | "unknown"
bsToAd(2083, 6, 16); // → 2026-10-02 (AD)
// fail-closed: no date + no signal = "unknown", never silently freshExports 9
extractPublishedDatetextStalenessassessFreshnessassessFreshnessWithAIfreshnessPromptparseAnyDatebsToAdadToBsnormalizeDigitsKeywords
More in Newsroom Kit
Deterministic fact-consistency checks for generated articles — extract every number, amount, percentage, date and named entity (Devanagari digits, लाख/करोड scaling, रु/NPR, %/प्रतिशत, AD + Bikram Sambat dates) and verify each appears in, or is derivable from, the sources. Catches fabricated or drifted figures without an LLM rewrite round; cross-script entity matching via @lacspace/translit. Isomorphic, deterministic.
@lacspace/trend-detectBurst / trending-topic detection over your own stream of items — score entities and terms by how far their recent frequency departs from a rolling baseline (z-score + growth), per category, English + Nepali, with stopword filtering. Rank a writer queue by what's actually rising. No platform scraping, deterministic, isomorphic.
@lacspace/feed-readerRead the feeds you follow — the read-side complement to @lacspace/rss. Parse a fetched RSS 2.0, RSS 1.0 (RDF), Atom 1.0 or JSON Feed 1.1 body into one normalized shape, autodiscover the feeds a web page advertises, and score each source's health (staleness vs its own cadence, duplicate/poisoned items, volume spikes, missing fields, fetch error rate) so a large source list prunes itself. Robots.txt respect via @lacspace/robots. Deterministic, isomorphic, zero third-party deps, bring-your-own-fetch.