Skip to content

InseeFr/Trevas-JS

Repository files navigation

Trevas JS

Trevas JS is a JavaScript engine for the Validation and Transformation Language. It is part of the Trevas family, together with the Trevas Java engine.

Trevas JS CI Coverage Quality Gate Status License: MIT

The documentation can be found in the docs folder and browsed online.

A Storybook is also available online.

Packages

Trevas JS is a Monorepo with the following modules.

@inseefr/trevas

npm version

The trevas package is the VTL engine itself, which exposes the interpret function root (named export).

@inseefr/vtl-2.0-antlr-tools

npm version

This package is generated by Antlr from the VTL 2.0 EBNF grammar; VtlLexer, VtlParser, VtlListener and VtlVisitor are exposed at root (named export).

Getting started

Use Trevas JS

To use Trevas JS in your JavaScript project, just run:

yarn add @inseefr/trevas

or

npm install @inseefr/trevas

Build Trevas JS

If you prefer to build Trevas JS locally, first clone the Github repository:

git clone https://github.com/InseeFr/Trevas-JS.git
cd Trevas-JS

Install the dependencies (yarn is required because of workspaces) and build the packages:

yarn
yarn build

Tests

Run once:

yarn test

Run with hot reloading:

yarn test-watch

Storybook

Run storybook:

yarn start-storybook

Archived packages

@inseefr/vtl-tools

This library is deprecated and no longer maintained. The last version is 0.1.15.

@inseefr/vtl-2.1-engine

This library is deprecated and no longer maintained. The last version is 0.1.9.

@inseefr/vtl-2.1-antlr-tools

This library is deprecated and no longer maintained. The last version is 1.0.0-rc2.