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

@jacksierkstra/checkr

v0.0.18

Published

A pure validation library.

Downloads

31

Readme

Checkr

CI NPM Version License

Checkr is a TypeScript-based XML validation library for validating XML documents against XSD schemas. It is designed to be lightweight, extensible, and dependency-free beyond pure TypeScript/JavaScript.

Features

  • Pure TypeScript: No native dependencies, works in Node.js and browsers.
  • Extensible Architecture: Supports plugin-like extensibility.
  • Comprehensive Validation: Handles global elements, complex types, attributes, constraints, and more.
  • XSD 1.0 Support: Covers basic to intermediate features like xs:sequence, xs:choice, enumerations, and type restrictions.

Installation

npm install @jacksierkstra/checkr

or

yarn add @jacksierkstra/checkr

Usage

import { Checkr } from "@jacksierkstra/checkr";

const xml = `<root><element>Value</element></root>`;
const xsd = `<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
              <xs:element name="root">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="element" type="xs:string"/>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:schema>`;

const validator = new Checkr();
const validation = validator.validate(xml, xsd);

validation.then(result => {
    console.log('Valid: ', result.valid);
    console.log('Errors: ', result.errors);
});

Validation Pipeline

The validation process consists of multiple pipeline stages:

  1. Parsing: Convert XML and XSD into DOM structures.
  2. Global Validation: Check elements against global definitions.
  3. Node-Level Validation:
    • Type validation (xs:string, xs:integer, etc.)
    • Attribute validation (required vs optional, fixed values)
    • Occurrence constraints (minOccurs, maxOccurs)
    • Enumerations and pattern constraints
  4. Choice Validation: Ensure valid xs:choice constraints.
  5. Recursive Validation: Validate nested elements and structure.

Supported XSD Features

  • xs:sequence, xs:choice
  • xs:element, xs:complexType
  • xs:enumeration, xs:pattern
  • xs:minLength, xs:maxLength
  • ✅ Attribute validation (xs:attribute)
  • 🚧 Planned:
    • xs:all
    • xs:extension and xs:restriction
    • xs:key, xs:unique, xs:keyref
    • Namespaced imports (xs:import, xs:include)

Running Tests

To run the test suite:

yarn test

Contributing

Contributions are welcome! Feel free to open issues and pull requests.

License

This project is licensed under the MIT License.


Maintained by @jacksierkstra