https://github.com/webdevbynight/schemata-validator
Check the validity of Schema.org vocabulary used in JSON-LD and HTML microdata
https://github.com/webdevbynight/schemata-validator
html html5 json-ld microdata schema-org validator web-semantic
Last synced: 2 days ago
JSON representation
Check the validity of Schema.org vocabulary used in JSON-LD and HTML microdata
- Host: GitHub
- URL: https://github.com/webdevbynight/schemata-validator
- Owner: webdevbynight
- License: mit
- Created: 2026-03-21T22:11:36.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-06-24T01:11:04.000Z (3 days ago)
- Last Synced: 2026-06-24T03:08:56.192Z (3 days ago)
- Topics: html, html5, json-ld, microdata, schema-org, validator, web-semantic
- Language: TypeScript
- Homepage:
- Size: 321 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# schemata-validator
Check the validity of Schema.org vocabulary used in JSON-LD and HTML microdata

[](https://nodejs.org/api/esm.html)
[](https://conventionalcommits.org)
[](https://biomejs.dev)
[](https://github.com/release-change/release-change)



**schemata-validator** takes JSON-LD data and microdata in HTML and returns detailed validation results.
## Installation
Install package for Node.js:
```
pnpm add --save-dev schemata-validator
```
You can also install it using `npm`:
```
npm install --save-dev schemata-validator
```
## Usage
### Options
##### data
Type: `array`
Specifies which JSON-LD data to be sent to validation. This option takes precedence over the other options.
##### files
Type: `array`
CLI arguments: `-f `, `--files `
Specifies which files to be sent to validation. This option takes precedence over the other options.
##### paths
Type: `array`
CLI arguments: `-p `, `--paths `
Specifies which folders or files to be sent to validation. When omitted, all files are validated (skipping the `node_modules` folder), unless the `exclude` option is specified.
##### exclude
Type: `array`
CLI arguments: `-e `, `--exclude `
Lists strings to match in paths to skip. When omitted, all files specified by `files` options if defined (all files otherwise) are validated (skipping the `node_modules` folder).
##### dryRun
Type: `boolean`
Default: `false`
CLI arguments: `-d`, `--dry-run`
Bypasses the validation (for usage while building CI).
### CLI
schemata-validator can be used as a CLI tool.
```
schemata-validator [flags]
```
#### `package.json` scripts
You can run `schemata-validator` from the `scripts` section of your `package.json` file.
```json
{
"scripts": {
"one-folder": "schemata-validator --paths docs",
"one-file": "schemata-validator --files docs/index.html",
"all-files": "schemata-validator"
}
}
```
#### Examples
- `schemata-validator`: validates all HTML files in the project;
- `schemata-validator --paths docs --exclude build tmp`: validates all HTML files in the `docs/` folder, except files which have `build` or `tmp` anywhere in their pathname or filename;
- `schemata-validator --files docs/index.html`: validates only the specified files.
### Application code
In addition to the CLI interface, schemata-validator can be imported and called in ESM and TypeScript projects.
```js
import { SchemataValidator } from "schemata-validator";
const jsonld = `{
"@context": "https://schema.org",
"@type": "WebPage",
"name": "Web page title",
"description": "Web page description"
}`;
const options = { data: [jsonld] };
const validator = new SchemataValidator(options);
const validate = await validator.validate();
validator.log(validate); // Outputs the reporting object
```
```js
import { SchemataValidator } from "schemata-validator";
const options = { paths: ["docs"] };
const validator = new SchemataValidator(options);
const validate = await validator.validate();
validator.log(validate); // Outputs the reporting object
```
## Get help
- [Stack Overflow](https://stackoverflow.com/questions/tagged/schemata-validator)
## Copyright & licence
© 2026 Victor Brito — Released under the [MIT licence](./LICENSE).