@welldot/core

@welldot/core

The TypeScript reference implementation of the .well format, with types, Zod validators, serialization, unit conversion, vocabularies and water quality data.

@welldot/core is the reference implementation of the .well format. It gives TypeScript and JavaScript programs everything needed to read, check and write .well files, with no DOM and no network access.

pnpm add @welldot/core
import { parseWell, serializeWell } from '@welldot/core';

const well = parseWell(text); // validated and typed; v1 files are upgraded
well.name = 'PT-01';
const out = serializeWell(well); // "version": "2.4", unknown members kept

What it contains

AreaExportsGuide
TypesWell and every object type (BoreHole, Lithology, HydrodynamicEvent, Permit, WaterSample, …)API reference
ValidationparseWell, WellSchema and one Zod schema per objectParsing and validating
SerializationserializeWell, deserializeWell, redactWell, isWellEmpty, hasWellDataSerializing and sharing
UnitsConversions between the canonical SI units and display unitsUnit conversion
VocabulariesEvery recommended and closed vocabulary with English and Portuguese labels, and the FGDC texturesVocabularies and textures
Water qualityThe 98-parameter vocabulary and the WHO, EU and Brazilian limit setsWater quality vocabulary
VersionsWELL_FORMAT_VERSION, version parsing and comparison, time zone checksVersions and time zones
DataThe JSON Schema (@welldot/core/well.schema.json) and 19 example wells (@welldot/core/examples/*)Example wells

Relationship to the spec

The package follows the specification and is tested against it: the vocabulary constants are compared with the spec's tables, and the spec's complete example must parse. The JSON Schema is generated from its Zod validators. The current release, 0.5.0, implements format revision 2.4.

Next