Under development

These pages are under development.

Overview

hed-typescript is the source of the hed-validator npm package. The package checks HED (Hierarchical Event Descriptors) annotations against a HED schema and reports what is wrong with them. This site assumes that you already know what HED is; if you do not, start at www.hedtags.org.

What the package validates

The package validates HED at four levels, from the smallest unit to the largest:

Level

What you give it

Main entry points

A HED string

One annotation string and the schemas

buildSchemasFromVersion, parseStandaloneString

A BIDS sidecar

The parsed contents of a JSON sidecar

BidsSidecar

A BIDS tabular file

The text of a TSV file and its merged sidecar

BidsTsvFile

A whole BIDS dataset

A directory, or the files of one picked by a user

BidsDataset.create with a file accessor, validate()

Each level has its own guide: Validating HED strings, Validating BIDS files, and Validating BIDS datasets. Each level builds on the one before it. Validating a sidecar validates every HED string in it, and validating a dataset validates each sidecar and each tabular file. Definitions, curly-brace splices, value columns, and the temporal tags (Onset, Offset, Inset, Duration, Delay) are checked at the levels where they become visible.

Every problem found comes back as an issue object with a HED error code, such as TAG_INVALID or SIDECAR_BRACES_INVALID. The codes are those of the HED specification, so the same problem has the same code here and in the Python tools.

Node.js and browsers

The same package runs in two environments:

  • Node.js (version 22 or later): the package can read a BIDS dataset straight from a directory.

  • Browsers, through a bundler such as Vite or webpack: the package reads the files that a user picks in the page, and never touches the local file system.

The schemas that the package bundles are available offline in both. See Installation and versions and Using the package in the browser.

Where HED itself is documented