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

@syllst/validator

v0.4.3

Published

CLI tool for validating Syllst MDX content

Readme

@syllst/validator

CLI tool for validating Syllst MDX content.

Installation

pnpm add @syllst/validator

Or install globally:

pnpm add -g @syllst/validator

CLI Usage

Basic Validation

# Validate a single file
syllst-validate lesson.mdx

# Validate a directory
syllst-validate lessons/

# Validate current directory recursively
syllst-validate . -r

Options

Usage:
  syllst-validate <file|directory> [options]

Arguments:
  <file>        Validate a single MDX file
  <directory>   Batch validate all MDX files in directory

Options:
  --strict              Enable strict validation mode
  --format=<format>     Output format: human (default), json
  --output=<file>       Write output to file instead of stdout
  --recursive, -r       Recursively search directories
  --quiet, -q           Only output errors (no warnings)
  --verbose, -v         Show detailed validation info
  --help, -h            Show help message
  --version             Show version

Examples

# Strict validation with verbose output
syllst-validate content/ --strict --verbose

# Generate JSON report
syllst-validate . -r --format=json --output=validation-report.json

# CI-friendly: quiet mode, exit code indicates success/failure
syllst-validate src/lessons/ -r -q

Output Formats

Human-Readable (Default)

Syllst Validation Report
========================================
Files: 3 | Valid: 2 | Invalid: 1

✓ lessons/lesson-01.mdx

✓ lessons/lesson-02.mdx

✗ lessons/lesson-03.mdx
  ✗ Lesson must have an id
  ✗ Grammar rule at index 0 must have a title
  ⚠ Missing recommended description field

✗ Validation failed: 1 file(s) with errors

Verbose Mode

✓ lessons/lesson-01.mdx
  Stages:
    Syntax:      ✓
    Structure:   ✓
    References:  ✓
    GLOST:       ✓
    External:    ✓
  Duration: 45ms

JSON Format

{
  "summary": {
    "total": 3,
    "valid": 2,
    "invalid": 1,
    "timestamp": "2026-01-27T10:30:00.000Z"
  },
  "results": [
    {
      "file": "lessons/lesson-01.mdx",
      "valid": true,
      "errors": [],
      "warnings": [],
      "stages": {
        "syntax": true,
        "structure": true,
        "references": true,
        "glost": true,
        "externalFormats": true
      },
      "duration": 45
    }
  ]
}

Validation Stages

The validator runs a multi-stage validation pipeline:

| Stage | Description | |-------|-------------| | Syntax | Zod schema validation of node structure | | Structure | Validates node relationships and hierarchy | | References | Validates internal references and IDs | | GLOST | Validates GLOST document references (if present) | | External Formats | Validates SCORM, xAPI, CMI5 extensions |

Programmatic API

import { validateCommand, formatHumanOutput, formatJsonOutput } from '@syllst/validator';
import type { ValidateOptions, FileValidationResult } from '@syllst/validator';

// Run validation programmatically
const options: ValidateOptions = {
  strict: true,
  format: 'human',
  recursive: true,
  quiet: false,
  verbose: false,
};

const exitCode = await validateCommand(['./content'], options);

Types

interface ValidateOptions {
  strict: boolean;           // Enable strict validation
  format: 'human' | 'json';  // Output format
  output?: string;           // Output file path
  recursive: boolean;        // Recursive directory search
  quiet: boolean;            // Suppress warnings
  verbose: boolean;          // Show detailed info
}

interface FileValidationResult {
  file: string;
  valid: boolean;
  errors: string[];
  warnings: string[];
  stages: {
    syntax: boolean;
    structure: boolean;
    references: boolean;
    glost: boolean;
    externalFormats: boolean;
  };
  duration: number;
}

Exit Codes

| Code | Meaning | |------|---------| | 0 | All files valid | | 1 | One or more files invalid |

CI Integration

GitHub Actions

- name: Validate Syllst content
  run: |
    pnpm exec syllst-validate content/ -r --strict -q

Pre-commit Hook

#!/bin/sh
pnpm exec syllst-validate content/ -r -q || exit 1

License

MIT