Examples
Node.js — Validate an IMF package
This example validates a local IMF package using @imferno/node, configures custom rule overrides with typed code constants, and prints the results.
Setup
Code
What's happening
-
validatePath(path, options?)reads an IMF package directory from disk, parses all XML files, and runs validation against every applicable SMPTE spec. -
codesgives you typed constants for all 250+ validation rules - autocomplete in your editor, no typos. -
result.validationcontainsis_compliant,errors,warnings,info, andcriticalarrays. Each issue has acode,message,severity, andlocation. -
result.packageis the full parsedImfernostruct with composition playlists, packing lists, asset map, and all essence descriptors. -
The process exits with code 1 if the package is non-compliant, making it easy to use in CI pipelines.
The full working example is in the repository at examples/node/:
See the Configuration page for all available options and the Validation Codes reference for the full rule catalogue.