New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

refsource

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

refsource

Look up reference data that carries its own source: every value comes with the URL it was read from and a verbatim quote from that page.

latest
npmnpm
Version
0.1.1
Version published
Weekly downloads
7
75%
Maintainers
1
Weekly downloads
 
Created
Source

refsource

Reference data lookups where every value comes back with the URL it was read from and a verbatim quote from that page.

npm install refsource
import { lookup } from "refsource";

const rows = await lookup("conforming-loan-limits", {
  state: "AL",
  county_name: "AUTAUGA COUNTY",
});

rows[0].value("limit_1_unit");
// '$832,750'

rows[0].get("limit_1_unit").source;
// 'https://www.fhfa.gov/document/d/cll/fullcountyloanlimitlist2026_hera-based_final_flat.csv'

rows[0].get("limit_1_unit").quote;
// '01,001,AUTAUGA COUNTY,AL,33860,"$832,750 ","$1,066,250 ",...'

Every value carries its own citation. That is the whole idea: an answer you can check beats an answer you have to trust.

272 datasets, 90,792 records, from referencesource.org — regulatory thresholds and deadlines, licensing rules by US state, version and end-of-support calendars, certification registers, exposure limits, insurance minimums, standards supersessions. Each one states its coverage, its sources and the date it was last checked.

There is an identical refsource package for Python.

Why it exists

If you ask a language model for a county loan limit, a state's minimum liability cover, or when an API model shuts off, you usually get a confident answer with no way to check it. In our own measurement of 271 such questions, 19% came back confident and wrong.

This package answers the same questions with the source attached, so the checking step is available rather than skipped — in your code, in a script, or in whatever an agent is doing on your behalf.

Usage

Find a dataset (no network — the catalogue ships with the package)

import { datasets, fields } from "refsource";

datasets("loan limit");            // [Dataset { slug: 'conforming-loan-limits', ... }]
fields("auto-insurance-minimums"); // ['state', 'bodily_injury_per_person', ...]

Look records up

await lookup("auto-insurance-minimums", { state: "Texas" });
await lookup("conforming-loan-limits", { fips_full: ["01001", "01003"] });
await search("ai-model-deprecation-and-retirement", "gpt-4", { limit: 5 });
await get("conforming-loan-limits", "01001");

Matching is case-insensitive and forgiving about spacing and punctuation, so "Autauga County" finds "AUTAUGA COUNTY". A filter naming a field that does not exist throws NoSuchField instead of returning an empty array — an empty result from a typo looks exactly like an empty result from a real absence, and one of those two is a wrong answer.

Datasets do not agree on how to spell things — one writes a state as TX, the next as Texas, because each says what its source says. When a filter matches nothing, ask what is actually there:

await dataset("auto-insurance-minimums").valuesOf("state", { limit: 5 });
// ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California']

Read the provenance

const [rec] = await lookup("conforming-loan-limits", { fips_full: "01001" });

rec.sourceUrl;     // the page or file this record was read from
rec.sourceQuote;   // the passage that states it, verbatim
rec.url;           // the published record's own page
rec.verified;      // '2026-08-10'
rec.staleAfter;    // '2027-08-10'
rec.cite();        // a citation you can paste somewhere

const v = rec.get("fha_limit_1_unit");
v.source;          // apps.hud.gov — a SECOND publisher's value, kept with
                   // its own source rather than folded in
v.confirmed;       // the value was found word-for-word in the quote
v.derived;         // our own reading rather than the page's words
v.disagreement;    // other sources' versions of this same field, if any

Three things are deliberately visible rather than smoothed over:

  • Fields from a second publisher keep that publisher's URL and quote. The FHFA conforming limit and the HUD/FHA limit sit in the same record; each cites the file it came from. Attributing one to the other would be a false citation.
  • derived marks our reading, not the page's words — a state name we normalised, an identifier we assembled.
  • disagreement is not hidden. Where two sources state a field differently, you get both, each with its own quote, and you decide.

JSON.stringify(rec) keeps every citation, so piping results somewhere else does not quietly drop the provenance.

Staleness

Every dataset carries the date by which it should be re-checked. Read the records of one that is past it and you get a warning naming the page with the current copy. Nothing is silently served as fresh.

Offline, caching, mirrors

Records are fetched on first use and cached on disk (24h by default; the catalogue itself needs no network at all).

configure({
  cacheTtl: 86400,      // 0 = always re-fetch, negative = never expire
  offline: true,        // cache only, never open a connection
  strict: true,         // throw if a bundle no longer matches its pinned hash
  baseUrl: "file:///path/to/site",   // a local copy or a mirror
  onWarning: (m) => myLogger.warn(m),
});

Every one of those has an environment variable too: REFSOURCE_CACHE, REFSOURCE_CACHE_TTL, REFSOURCE_OFFLINE, REFSOURCE_STRICT, REFSOURCE_BASE_URL, REFSOURCE_TIMEOUT.

Hash pinning. The package holds the SHA-256 of every bundle as of the release. If a fetched bundle differs, the dataset was re-verified upstream since this version was cut — you get the live copy plus a warning, or an IntegrityError under strict. The point is that a change is visible rather than silent.

Command line

$ npx refsource datasets loan limit
$ npx refsource fields conforming-loan-limits
$ npx refsource lookup conforming-loan-limits fips_full=01001
$ npx refsource search ai-model-deprecation-and-retirement gpt-4 --limit 5
$ npx refsource show conforming-loan-limits 01001 --json
01001
  county_name: AUTAUGA COUNTY
  state: AL
  limit_1_unit: $832,750
  fha_limit_1_unit: 541,287
      from https://apps.hud.gov/pub/chums/cy2026-forward-limits.txt
      quoted: "3386000000MONTGOMERY, AL 203B S02200000541287069305008377001041125AL001…"
  source: https://www.fhfa.gov/document/d/cll/fullcountyloanlimitlist2026_hera-based_final_flat.csv
  quoted: "01,001,AUTAUGA COUNTY,AL,33860,"$832,750 ","$1,066,250 ","$1,288,800 ","$1,601,750 ""
  page:   https://referencesource.org/conforming-loan-limits/01001/
  verified 2026-08-10

What is in the catalogue

A sample of the 272 datasets:

datasetwhat it answers
conforming-loan-limitsthe FHFA and FHA loan limits for every US county
auto-insurance-minimumsminimum liability cover by US state
ai-model-deprecation-and-retirementwhen an API model was deprecated and what replaces it
software-end-of-supportend-of-support dates from each vendor's own page
iso-standard-supersessionswhat withdrew or replaced an ISO standard
workplace-exposure-limitsOSHA and Cal/OSHA permissible exposure limits
fips-140-module-validation-statuswhether a cryptographic module's validation is still active
drinking-water-contaminant-limitsEPA maximum contaminant levels

datasets() lists them all, offline.

Requirements

Node 18 or newer. No dependencies, and none planned.

Data, licensing and accuracy

The records are facts with attribution, not reproductions. Each dataset states its own licence position and links the source it was read from; the package code is MIT. Where a source's terms forbid reuse, the dataset is not published at all.

No value is ever supplied by this package or by a model — if a source does not state something, the row is omitted rather than guessed. Where you need to be sure, the quote and the URL are right there: check it.

Found something wrong? That is the one thing worth reporting — https://referencesource.org/ has the contact and the method behind every dataset.

Keywords

reference-data

FAQs

Package last updated on 02 Sep 2026

Related posts