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

domtree-fixture-foundry

v0.1.5

Published

Generate clean, consistent, and test-ready data fixtures — faster, smarter, and with quality intact.

Downloads

17

Readme

🧩 Fixture Builder by domtree.com

Generate clean, consistent, and test-ready data fixtures — faster, smarter, and with quality intact.

npm


🚀 Overview

Domtree Fixture Builder is a lightweight CLI that transforms real data into normalised, ready-to-use fixtures for Cypress, Playwright, or raw JSON tests.

It now also includes AI-powered extraction for unstructured documents — letting you convert PDFs and Word files into structured JSON automatically.

Human insight. AI precision. Build quality test data faster, with real product understanding.


✨ Features

  • 📄 CSV / JSON ingestion — reads and cleans raw structured data
  • 🧠 AI document extraction (PDF / DOCX) — turns reports or specs into JSON
  • ⚙️ Schema inference — detects numeric, boolean, date, email, and enum types
  • 🔒 Deterministic masking — hides PII while keeping data stable
  • 🧩 Test-ready output — generates fixtures for Cypress, Playwright, or raw JSON
  • 🧱 Configurable rules — custom mappings, enrichment, and masking
  • Repeatable builds — deterministic for stable CI runs

⚡ Quickstart

1️⃣ Install

npm i -D domtree-fixture-foundry

2️⃣ Create Your Input Data

You can start with a CSV, JSON, PDF, or DOCX file.

Example CSV

mkdir -p data
curl -L -o data/users.csv https://raw.githubusercontent.com/datablist/sample-csv-files/main/files/people/people-100.csv

Example PDF (test.pdf)

A table of companies like:

| Company | Contact | Telephone no | Address | Status | | ------- | ---------- | ------------ | ------------ | ------ | | Abc1 | John Smith | 01223232332 | 23 Test Road | Live | | Abc2 | Dan James | 12128176287 | 24 Test Road | Live |

3️⃣ Create a Config File

Create a file named domtree.config.json in your project root:

{
  "input": "data/users.json",
  "frameworks": ["cypress", "playwright", "raw"],
  "outputDir": "dist",
  "datasetName": "users",
  "mask": ["email", "phone"]
}

Key Description input Path to your source data (CSV, JSON, PDF, DOCX) frameworks Output fixture formats outputDir Folder for generated fixtures datasetName Base name for files mask Fields to anonymise deterministically

💡 You can add optional keys like infer, mappings, or enrich for custom data rules.

🧠 AI-Powered Document Extraction

Use AI to extract structured data from unstructured documents (PDF or DOCX). The model automatically identifies tables, fields, and relationships, returning clean JSON.

Uses OpenAI GPT-4o-mini for efficient, accurate extraction.

📄 Example: PDF Extraction

Input: data/test.pdf (a table of companies)

Run:

npx domtree-fixtures extract --input data/test.pdf --output data/test.json --ai

Output:

[
  {
    "company": "Abc1",
    "contact": "John Smith",
    "telephone": "01223232332",
    "address": "23 Test Road",
    "status": "Live"
  },
  {
    "company": "Abc2",
    "contact": "Dan James",
    "telephone": "12128176287",
    "address": "24 Test Road",
    "status": "Live"
  }
]

✅ AI reads the PDF, recognises headers, and structures the table automatically.

📝 Example: DOCX Extraction

Input: data/companies.docx (table or structured text)

Run:

npx domtree-fixtures extract --input data/companies.docx --output data/companies.json --ai

Output:

[
  {
    "company": "Abc1",
    "contact": "John Smith",
    "telephone": "01223232332",
    "address": "23 Test Road",
    "status": "Live"
  },
  {
    "company": "Abc2",
    "contact": "Dan James",
    "telephone": "12128176287",
    "address": "24 Test Road",
    "status": "Live"
  }
]

✅ Works for both Word tables and paragraph key/value structures. AI automatically infers headers and returns consistent JSON objects.

🔧 Without AI (Basic Extraction)

If you don’t include --ai, the tool will still attempt a simple text or table parse using built-in logic.

Example:

npx domtree-fixtures extract --input data/test.pdf --output data/test_raw.json

Output:

[
  { "rawText": "Company Contact Telephone no Address Status ..." }
]

⚙️ Full Fixture Generation Example

Once you have clean JSON (either from CSV, DOCX, or PDF):

npx domtree-fixtures generate --config domtree.config.json

Results:

dist/
├─ cypress/fixtures/users.json
├─ tests/fixtures/users.ts
└─ users.json

🧩 Environment Setup for AI

Create a .env file in your project root:

OPENAI_API_KEY=sk-...

Ensure this is not committed to Git by adding .env to your .gitignore.

🧠 How It Works

Reads your input file (CSV, JSON, DOCX, or PDF)

Extracts or generates structured JSON

Infers schema and masks sensitive data

Outputs normalised fixtures for your testing frameworks

The combination of automation efficiency + AI product insight means you move faster — without losing quality.

🪜 Example End-to-End Flow

1️⃣ Add your data in data/ 2️⃣ Create domtree.config.json 3️⃣ (Optional) Add .env with your OpenAI key 4️⃣ Run extraction:

npx domtree-fixtures extract --input data/test.pdf --output data/test.json --ai

5️⃣ Generate fixtures:

npx domtree-fixtures generate --config domtree.config.json

6️⃣ Use them in Cypress / Playwright tests.

💬 Output Example (Cypress)

cypress/fixtures/users.json

[
  { "name": "Jane Doe", "email": "[email protected]", "age": 28 }
]

🧱 Roadmap

| Phase | Focus | Status | | ----- | ----------------------------------------------- | -------------- | | 1 | CSV/JSON schema inference + fixture generation | ✅ Done | | 2 | AI-powered extraction for PDF & DOCX | ✅ Done | | 3 | OCR for scanned PDFs (Tesseract.js) | 🚧 In progress | | 4 | Cloud API for bulk extraction + team dashboards | 🔜 Planned |