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

node-red-contrib-html-validation-report

v0.2.1

Published

Two Node-RED nodes for validating workbook-like data and generating a rich HTML report.

Readme

node-red-contrib-html-validation-report

Two Node-RED nodes for validating workbook-like data and generating a rich HTML report.

  • data-validation-engine (simplified): rule-based checks for:
    • sheetsExist — required sheet names present & non-empty
    • sheetHasColumns — required columns exist (supports dot paths)
    • Optional single condition per rule (attr/op/rhs)
    • Rules editable in the node or loaded from a JSON file under userDir
  • validation-report: produces a modern, interactive HTML report:
    • Dark/light theme, sticky toolbar, search & highlight
    • Rule-level and sheet-level sections
    • Row pagination (10/25/50/100), counters, badges
    • Export visible rows (CSV, JSON), copy-to-clipboard, print

New in this repo
Report node supports typed input/output paths (msg/flow/global).
It also handles logs that use id instead of ruleId, and message instead of value.


Install

npm i node-red-contrib-html-validation-report
# then restart Node-RED

Or from Node-RED editor: Menu → Manage palette → Install → search for node-red-contrib-html-validation-report.


Nodes

1) data-validation-engine

Validates an object model (usually built from Excel/CSV) using a small ruleset.

Capabilities

  • Two rule types:

    • sheetsExist: requiredSheets: string[]
    • sheetHasColumns: sheet: string, requiredColumns: string[] (dot paths allowed)
  • Optional rule-level condition:

    • { conditions: { and: [{ attribute, operator, rhsType, value }] } }
    • Operators: ==, !=, contains, !contains, regex, isEmpty, !isEmpty
    • RHS types: str|num|bool|msg|flow|global|env|jsonata
  • Rules stored in-node or in a JSON file (userDir-relative), with lock & watch options

Input

  • Source root chosen by typed input: msg / flow / global
  • Path defaults to msg.data

Output

  • msg.validation = { logs, counts }

    • logs[]: { id, type, level, message, description }
    • counts: { info, warning, error, total }
  • Node status bubble shows E: W: I:

Example rules JSON (file mode)

[
  {
    "type": "sheetsExist",
    "id": "RULE_SHEETS_EXIST",
    "description": "Verify that required sheets exist and are not empty",
    "requiredSheets": ["NAME", "PRICE"],
    "level": "error"
  },
  {
    "type": "sheetHasColumns",
    "id": "RULE_COLUMNS_NAME",
    "description": "Check that sheet includes name, etc fields",
    "sheet": "NAME",
    "requiredColumns": ["name", "grade" etc],
    "level": "warning"
  }
]

2) validation-report

Turns msg.validation (or any logs array) into a feature-rich HTML file.

Input (typed)

  • Choose scope/path to read validation from (default: msg.validation)

    • Accepts either:

      • { logs, counts }, or
      • logs[] directly

Output (typed)

  • Choose scope/path to write HTML to (default: msg.payload)
  • Optional fixed filename → written to chosen scope/path (default: msg.filename)

Compatibility note

  • The report groups by ruleId or id (falls back to rule or (unknown)).
  • The “Value” column uses value or message if value is absent.
    • The report maps rules[].id → rules[].suggestions[].

Typical flow

[ inject ] → [ data-validation-engine ] → [ validation-report ] → [ file ]
  • Configure data-validation-engine to read your model (e.g., msg.data).
  • Configure validation-report input: msg.validation.
  • Configure validation-report output: msg.payload.
  • Set Fixed filename (optional): logs/report.html.
  • File node writes msg.payloadmsg.filename.

Screenshot Validation Report


Log format (expected)

Either:

{
  "logs": [
    {
      "id": "RULE_SHEETS_EXIST",
      "type": "sheetsExist",
      "level": "error",
      "message": "Sheet 'PRICE' exists and is not empty.",
      "description": "Verify that required sheets exist and are not empty"
    }
  ],
  "counts": { "info": 0, "warning": 2, "error": 8, "total": 10 }
}

Or directly:

[
  { "id": "RULE_SHEETS_EXIST", "type": "sheetsExist", "level": "error", "message": "..." },
  { "id": "RULE_COLUMNS_NAME", "type": "sheetHasColumns", "level": "warning", "message": "..." }
]

The report will display the rule header as the id (or ruleId), and use message as the “Value” when value is absent.


File structure

.
├─ data-validation-engine.js
├─ data-validation-engine.html
├─ validation-report.js
├─ validation-report.html
├─ package.json
├─ README.md
└─ docs/
   └─ screenshot.png

Changelog

  • 0.2.0

    • Initial release: simplified validation engine report
    • Typed input/output for both nodes
    • Report supports id/ruleId and message/value fallbacks

License

MIT © AIOUBSAI