npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@univ-lehavre/atlas-crf-fixtures

v1.0.0

Published

CRF data-dictionary CSV parser and deterministic fake-record generator for tests and fixtures in the atlas monorepo.

Readme

@univ-lehavre/atlas-crf-fixtures

Parser de dictionnaire de données CRF (format CSV) et générateur déterministe de faux records, pour construire des fixtures de test dans le monorepo atlas.

Deux briques indépendantes :

  • src/csv.ts — parse l'export CSV standard d'un dictionnaire de données CRF (colonnes field_name, form_name, field_type, field_label, select_choices_or_calculations…) en structure typée.
  • src/fake.ts — génère des records cohérents avec un dictionnaire donné, de façon déterministe (PRNG seedé, jamais de Math.random non-seedé).

Parser de dictionnaire

import { parseDictionary, parseChoices } from '@univ-lehavre/atlas-crf-fixtures';

const dictionary = parseDictionary(csvContent);
// dictionary.fields: DictionaryField[]

const sex = dictionary.fields.find((f) => f.field_name === 'sex');
parseChoices(sex?.select_choices_or_calculations);
// => [{ code: '1', label: 'Male' }, { code: '2', label: 'Female' }]

Le parser accepte aussi bien les en-têtes verbeux de l'export ("Variable / Field Name", "Choices, Calculations, OR Slider Labels", …) que les en-têtes canoniques en snake_case (field_name, …). Les colonnes optionnelles peuvent être absentes ; les colonnes inconnues sont ignorées. Une DictionaryParseError est levée si le CSV est malformé, si une colonne requise manque ou si un field_type est inconnu.

Générateur de faux records

import { generateRecords } from '@univ-lehavre/atlas-crf-fixtures';

const records = generateRecords(dictionary, { count: 10, seed: 42 });

Garanties :

  • Déterministe : même dictionnaire + même seed ⇒ mêmes records.
  • Cohérent : les champs catégoriels (dropdown, radio) reçoivent un code valide du dictionnaire ; les checkbox sont éclatés en colonnes field___code ; les text avec validation date*/integer respectent leur format.
  • Champ identifiant : par défaut le premier champ reçoit un id séquentiel ("1", "2", …) ; configurable via recordIdField.
  • Mode sparse : optionnellement, certains champs optionnels sont laissés vides (de façon déterministe) pour simuler des données réelles parcellaires.

Options

| Option | Défaut | Description | | --------------- | ------------- | ---------------------------------------- | | count | 1 | Nombre de records à générer. | | seed | 1 | Graine du PRNG déterministe. | | recordIdField | premier champ | Champ recevant l'id séquentiel. | | sparse | false | Laisse vides certains champs optionnels. |

Scripts

pnpm --filter=@univ-lehavre/atlas-crf-fixtures build
pnpm --filter=@univ-lehavre/atlas-crf-fixtures typecheck
pnpm --filter=@univ-lehavre/atlas-crf-fixtures lint
pnpm --filter=@univ-lehavre/atlas-crf-fixtures test:coverage