{"id":25608050,"url":"https://github.com/timbeadle/tv4-reporter","last_synced_at":"2026-01-27T19:36:22.150Z","repository":{"id":12060702,"uuid":"14647213","full_name":"timbeadle/tv4-reporter","owner":"timbeadle","description":"Report Tiny Validator tv4 results in usable formats","archived":false,"fork":false,"pushed_at":"2025-06-18T14:50:45.000Z","size":4404,"stargazers_count":5,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-18T15:42:49.287Z","etag":null,"topics":["json-schema","needs-maintainer","reporter","tv4"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"errbotio/errbot","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timbeadle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-11-23T17:45:01.000Z","updated_at":"2025-06-18T14:50:48.000Z","dependencies_parsed_at":"2024-03-19T09:29:28.946Z","dependency_job_id":"69e366f9-e159-4c8b-bb77-be32677687ed","html_url":"https://github.com/timbeadle/tv4-reporter","commit_stats":{"total_commits":601,"total_committers":9,"mean_commits":66.77777777777777,"dds":0.5507487520798668,"last_synced_commit":"b4b0f91dc035cc95fe36e4b77deb290477c00fde"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/timbeadle/tv4-reporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timbeadle%2Ftv4-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timbeadle%2Ftv4-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timbeadle%2Ftv4-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timbeadle%2Ftv4-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timbeadle","download_url":"https://codeload.github.com/timbeadle/tv4-reporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timbeadle%2Ftv4-reporter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260585366,"owners_count":23032234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json-schema","needs-maintainer","reporter","tv4"],"created_at":"2025-02-21T20:17:52.888Z","updated_at":"2026-01-27T19:36:22.144Z","avatar_url":"https://github.com/timbeadle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tv4-reporter\n\n[![npm version](https://img.shields.io/npm/v/tv4-reporter.svg)](https://www.npmjs.com/package/tv4-reporter)\n[![Downloads/month](https://img.shields.io/npm/dm/tv4-reporter.svg)](https://www.npmjs.com/package/tv4-reporter)\n[![Build Status](https://github.com/timbeadle/tv4-reporter/workflows/Node.js%20CI/badge.svg)](https://github.com/timbeadle/tv4-reporter)\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo)\n[![Code Climate](https://codeclimate.com/github/timbeadle/tv4-reporter/badges/gpa.svg)](https://codeclimate.com/github/timbeadle/tv4-reporter)\n[![Known Vulnerabilities](https://snyk.io/test/github/timbeadle/tv4-reporter/badge.svg)](https://snyk.io/test/github/timbeadle/tv4-reporter)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\n\n\u003e Reporters to display usable [Tiny Validator tv4](https://github.com/geraintluff/tv4) output of [json-schema](http://jsonschema.org) validation.\n\nThis module is used by various dependents to render `tv4` validation result objects in a compact but highly readable (and possibly colourful) format. Functionality is tuned for both CLI output as well as plain-text or pre-formatted HTML/CSS.\n\n**Note:** at this point this is *not* a 'validator' or 'test runner', nor is it a finished application. It is a library to use as dependency in `tv4` based testers. Use plain `tv4` and pass the result(s) to one of `tv4-reporters` helpers. If you are looking for a validator see one of the implementing tv4 wrappers for convenience (some linked below).\n\n## Features\n\n* Indented, tree-like display.\n* Single and multiple errors.\n* Optionally display summaries.\n* Recursive sub-errors (as generated by `anyOf`, `oneOf` etc).\n* Missing sub-schemas (optionally report as fail or pass reason).\n* Various output writer/coloriser modes using [ministyle](https://github.com/Bartvds/ministyle) and [miniwrite](https://github.com/Bartvds/miniwrite).\n\n## Examples\n\n(possibly outdated)\n\n1. Examples of many different kind of errors in [this Travis-Ci build](https://travis-ci.org/Bartvds/grunt-tv4/jobs/14469941).\n1. Bulk reporter with single error:\n\n  [![WebStorm example](https://raw.github.com/timbeadle/tv4-reporter/main/media/webstorm-example-01.png)](https://raw.github.com/timbeadle/tv4-reporter/main/media/webstorm-example-01.png)\n\n## Installation\n\n```shell\n$ npm install tv4-reporter --save-dev\n```\n\n## Usage\n\nStill very-much in flux so possibly outdated examples.\n\nMinimal use case (likely this is spread over the implementing application):\n````js\n// assemble the components\nvar tv4 = require('tv4');\nvar out = require('miniwrite').console();\nvar style = require('ministyle').ansi();\nvar reporter = require('tv4-reporter').getReporter(out, style);\n\n// now validate\nvar result = tv4.validateMultiple(myValue, mySchema);\nif (!result.valid || result.missing.length \u003e 0) {\n\t// get data object (might get these in bulk/async from somewhere)\n\tvar res = reporter.createTest(mySchema, myValue, 'my special test', true);\n\n\t// report error\n\treporter.reportResult(res);\n\n\t// if you have a many results you can use bulk to print nicely with summaries\n\treporter.reportBulk([res, res2, res3], [pass1, pass2]);\n\n\t// only totals\n\treporter.reportTotals(3, 4);\n}\n````\n\nBulk reporting:\n````js\n// if you have a many results you can use bulk to print nicely with summaries\nreporter.reportBulk([res, res2, res3], [pass1, pass2]);\n\n// only totals\nreporter.reportTotals(3, 4);\n````\n\nFor more API surface like (partial) reporter and various helpers see the exports in the main module. Also see the 'known dependants' for more examples.\n\n## Output\n\nReport output and styling done via extensible mini-api's:\n\n* [ministyle](https://github.com/Bartvds/ministyle) (bundled with plain, ansi, html/css etc + utils)\n* [miniwrite](https://github.com/Bartvds/miniwrite) (bundled with streaming console.log, line buffer, node-streams etc + utils)\n\n## Known dependents\n\n* [grunt-tv4](https://github.com/timbeadle/grunt-tv4) (bulk validator with http lookup for grunt)\n* ~~[chai-json-schema](https://github.com/Bartvds/chai-json-schema) (assertion wrappers)~~ (update in progress)\n* (planned) a commandline validator (cued for extraction from `grunt-tv4`)\n* (planned) a json-schema assert()-ion (chai-json-schema without chai)\n\n## Future\n\n1. Output will likely be tuned over time.\n1. Current version is very functional but doesn't yet do anything specific for each validation rule type.\n\n### Release support matrix\n\n| Release | Min Node ver. | Support     |\n| ------- | ------------- | ----------- |\n| 1.x     | 4.0.0         | Obsolete    |\n| 2.x     | 8.0.0         | Obsolete    |\n| 3.x     | 8.0.0         | Obsolete    |\n| 4.x     | 10.0.0        | Obsolete    |\n| 5.x     | 12.0.0        | Obsolete    |\n| 6.x     | 14.0.0        | Security    |\n| 7.x     | 16.14.0       | Current     |\n\n## Release history\n\n* See [CHANGELOG](https://github.com/timbeadle/tv4-reporter/blob/main/CHANGELOG.md).\n\n## Build\n\nNothing much here as the code is still being extracted from the original projects.\n\n~~Install development dependencies in your git checkout:~~\n\n    $ npm install\n\n~~Build and run tests:~~\n\n    $ grunt\n\nSee the `Gruntfile.js` for additional commands.\n\n## Contributing\n\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n*Note:* this is an opinionated module: please create a [ticket](https://github.com/timbeadle/tv4-reporter/issues) to discuss any big ideas. Pull requests for bug fixes are of course always welcome.\n\n## License\n\nCopyright (c) 2013 Bart van der Schoor\n\nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimbeadle%2Ftv4-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimbeadle%2Ftv4-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimbeadle%2Ftv4-reporter/lists"}