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

@theodi/data-standard-validator

v1.0.0

Published

Validate JSON and JSON-LD documents against SHACL shapes, with plain-English errors that point at the JSON path and line.

Readme

data-standard-validator

Validate JSON and JSON-LD documents against SHACL shapes. Problems are explained in plain English and point at the JSON path and line where they occur. Reports can be output as text, JSON, or Markdown.

SHACL engines such as rdf-validate-shacl and shacl-engine take an RDF dataset and return a SHACL validation report made of IRIs and blank node IDs. This library sits on top of one: it uses rdf-validate-shacl under the hood, and adds the parts around it. It turns JSON into RDF via a JSON-LD context, maps each result back to a JSON path and line (address[0].postcode, not _:b3), words it from the shape's own descriptions, and ships a CLI and report formats.

Documentation site · npm package · CLI reference · Library API · How it works · Web component · Web demo

Install

Requires Node.js 22 or later.

npm install --save-dev @theodi/data-standard-validator
npx data-standard-validator --help

For one-off use without adding it to a project, run npx --yes @theodi/data-standard-validator --help.

Example

npx --yes @theodi/data-standard-validator -s person-shape.ttl person.json
person-shape.ttl · 1 document(s)

person.json -> fails
  in Person
    x Missing required field name
      at name  line 1
      Add `name`: The person's full name.
    x age must be at least 0 - you gave -1
      at age  line 9
          9 |   "age": -1
            |          ^^

2 problems
  1 required field missing, 1 out of range

The full example shows the shape, the document, and the same report as JSON and Markdown.

Command line

npx data-standard-validator -s shapes.ttl data.json

The command is available through npx after installation. The exit code is 0 when every document conforms and 1 when one does not. See the CLI reference for every option, output format and exit code.

Library

import { validate, formatReport } from '@theodi/data-standard-validator'

const report = await validate({
  shapes: 'https://example.org/shapes/person.ttl',
  context: 'https://example.org/context.jsonld',   // optional
  data: ['person-1.json', 'person-2.json'],
})

report.conforms                           // boolean
report.documents[0].issues                // what is wrong, and where
formatReport(report, 'markdown')          // or 'text' / 'json'

To validate many documents, load the shapes once:

import { createValidator } from '@theodi/data-standard-validator'

const validator = await createValidator({ shapes: 'shape.ttl' })
const result = await validator.validate({ name: 'upload.json', text: body })

The same API works in the browser. There, sources are URLs or inline { text } / { json } objects. See the API reference.

Web component

data-standard-validator-component is a web component that provides a validation user interface on top of this library. See the demo for it in action and an example of how to use it.

Development

npm install
npm test            # unit, pipeline, format and CLI tests - offline
npm run typecheck
npm run build       # dist/, which is what gets published

License

Licensed under the Apache License 2.0. See the LICENSE file for details.