Getting started
Installation
Install @welldot/core with npm, pnpm or yarn, check the requirements, and find the JSON Schema and example files it ships with.
pnpm add @welldot/core
npm install @welldot/core
yarn add @welldot/core
Requirements
- Node.js 18 or later, or any modern browser or bundler. The package has no DOM or network dependency, so it also runs in workers and edge runtimes.
- ES modules and CommonJS are both published (
importandrequire), with TypeScript declarations. - Dependencies:
zod3 (the validators are Zod schemas) anddefu. They install with the package.
What else is in the package
| Path | Contents |
|---|---|
@welldot/core | The library: types, validators, serialization, units, vocabularies. |
@welldot/core/well.schema.json | The JSON Schema for v2, the same file published at https://welldot.org/schema/v2/well.schema.json. |
@welldot/core/examples/<file>.well | The 19 example wells. |
// Node: read an example from the installed package
import { readFile } from 'node:fs/promises';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const path =
require.resolve('@welldot/core/examples/coluna-mg-cristalino-abastecimento.well');
const text = await readFile(path, 'utf8');
Versions
The package follows semantic versioning from 1.0 onward; during 0.x a minor release can change the API, and the changelog says how. Format support by release:
@welldot/core | Format revision |
|---|---|
| 0.5.0 | 2.4 (writes "2.4") |
| 0.4.0 | 2.3 |
| 0.3.0 | 2.1 |
| 0.2.0 | 2.0 |
Releases up to 0.4.0 reject files with
"version": "2.4". Update every program that reads your files before any of them starts writing 2.4 files.