{"name":"tv4-reporter","version":"8.0.0","keywords":["tv4","format","reporter","json-schema"],"author":{"url":"https://github.com/Bartvds","name":"Bart van der Schoor"},"_id":"tv4-reporter@8.0.0","maintainers":[{"name":"bartvds","email":"bartvanderschoor@gmail.com"},{"name":"t1mmyb","email":"tim@takkconsulting.co.uk"}],"homepage":"https://github.com/timbeadle/tv4-reporter","bugs":{"url":"https://github.com/timbeadle/tv4-reporter/issues"},"dist":{"shasum":"23596f7d53579bd23217e469f4b82021e2eaf6fa","tarball":"http://registry-npm.ywwl.com/tv4-reporter/download/tv4-reporter-8.0.0.tgz","fileCount":13,"integrity":"sha512-RHQQw6wKk6Wr7SrporieRTIqrE87tBWNvuof/yl2ZTuZ3JVkRZ0d8xysTrzOjZp0jROnDJET7dPBU5rDDNbghw==","signatures":[{"sig":"MEYCIQD1GPbUK8KDkcOcPjISTvvxnqe83dzdp5bEK9iZXN1dSgIhAOnjjwO3SovcMzBQloZXd4FwFNOq/923qeU4y3Pk5chH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42416,"size":24886,"noattachment":false,"key":"/tv4-reporter/-/tv4-reporter-8.0.0.tgz"},"main":"lib/reporter.js","snyk":true,"volta":{"npm":"11.5.2","node":"20.19.4"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"engines":{"node":">= 20.19.4"},"gitHead":"68950de106e10ef3ede3e93c3840b1a096e80ac5","scripts":{"test":"npm run test:snyk && npm run test:lint && npm run test:engines","prepare":"npm run snyk-protect","test:ci":"npm run test:lint && npm run test:engines","test:lint":"xo xo.config.cjs lib/*.js","test:snyk":"snyk test --dev","snyk-protect":"snyk-protect","test:engines":"ls-engines"},"_npmUser":{"name":"t1mmyb","email":"tim@takkconsulting.co.uk"},"licenses":[{"url":"https://github.com/timbeadle/tv4-reporter/blob/main/LICENSE-MIT","type":"MIT"}],"repository":{"url":"git+https://github.com/timbeadle/tv4-reporter.git","type":"git"},"_npmVersion":"10.8.3","description":"Report Tiny Validator tv4 results in usable formats","directories":{},"_nodeVersion":"22.9.0","dependencies":{"ministyle":"~0.1.4","miniwrite":"~0.1.4","jsonpointer":"^5.0.1","@snyk/protect":"^1.1298.2"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.1","tv4":"1.3.0","globals":"^16.3.0","prettier":"3.6.2","commitizen":"^4.3.1","ls-engines":"^0.9.3","@types/jsonpointer":"^4.0.2","cz-conventional-changelog":"^3.3.0"},"peerDependencies":{"tv4":"^1.3.0","ministyle":"~0.1.4","miniwrite":"~0.1.4"},"_npmOperationalInternal":{"tmp":"tmp/tv4-reporter_8.0.0_1754387142624_0.46662509433278077","host":"s3://npm-registry-packages-npm-production"},"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> 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 > 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","publish_time":1754387142813,"_cnpm_publish_time":1754387142813,"dist-tags":{"latest":"8.1.0","latest-4x":"4.3.3","latest-5x":"5.0.3","latest-6x":"6.1.0","latest-7x":"7.1.0"}}