Helper package for GHS Hazard (H), Precautionary (P) and EU-related (EUH) statements. This package provides a type-safe way to manage, validate, and translate GHS statements.
Primarily used for the periodic table database and pse-info.de.
Visit pseinfo.github.io/hp-statements to get a searchable list of all statements and translations.
- Type-safe: Full TypeScript support for all H, P, and EUH codes.
- Fluent Factory: Easily build sets of statements with context.
- Translator: Dynamic loading of translations in 24 languages.
npm install @pseinfo/hp-statementsBuild a collection of statements:
import { HP } from '@pseinfo/hp-statements';
const statements = HP()
.H( 'H200' ).EUH( 'EUH031' )
.P( 'P101', { note: 'Substance is only hazardous when ...' } )
.toObj();Retrieve translations dynamically:
import { Translator } from '@pseinfo/hp-statements';
// Get a single translation
const text = await Translator.one( 'H200', 'de' );
// Get all translations for a code
const translations = await Translator.allOf( 'H200' );
// Get all statements for a language
const allFr = await Translator.all( 'fr' );Validate codes:
import { Assert } from '@pseinfo/hp-statements';
Assert.isHCode( 'H200' ); // true
Assert.assertHCode( 'invalid' ); // Throws ErrorAccess codes directly from data directory:
import H201 from '@pseinfo/hp-statements/data/code/H/H201';
const text = H201.translations.en; // Explosive; mass explosion hazard.
const code = H201.code; // 'H201'Also, the data/lang directory includes JSON files with all statements for each language.
The data is obtained automatically via npm run fetch from the mhchem/hpstatements repository.
The data is licensed under CC BY 4.0.
Copyright © European Union, 1998-2025, CC BY 4.0.
Copyright © hpstatements contributors, 2019-2025, CC BY 4.0.
This project is licensed under the MIT License; see the LICENSE file for details.
Copyright © 2026 Periodic Table by Paul Köhler (komed3). All rights reserved.