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

medhira-ajv-utils

v0.0.1

Published

Custom AJV formats and keywords for validation - Powered by MEDHIRA

Readme


medhira-ajv-utils

MEDHIRA AJV Utils is an advanced utility package designed to extend AJV (Another JSON Schema Validator) with custom formats and keywords, allowing developers to create more precise and tailored JSON schema validations. This package simplifies the process of defining complex validation rules, making it easier to handle specific application logic directly within your JSON schema.

Why MEDHIRA?

In modern applications, data validation is critical. MEDHIRA AJV Utils provides:

  • Ready-to-use Formats - Pre-built validation for common patterns
  • Custom Keywords - Extend AJV with your own validation logic
  • India-Specific Formats - PAN, IFSC, PIN code, Udyam validation
  • TypeScript Support - Full type definitions included
  • Zero Dependencies - Lightweight and fast

Installation

# NPM
npm install --save medhira-ajv-utils ajv ajv-formats ajv-errors

# Yarn
yarn add medhira-ajv-utils ajv ajv-formats ajv-errors

Usage

import Ajv from 'ajv';
import ajvErrors from 'ajv-errors';
import ajvFormats from 'ajv-formats';

import { ajvCustomFormatsRegistry, ajvCustomKeywordsRegistry } from 'medhira-ajv-utils';

ajvErrors(ajv);
ajvFormats(ajv);

ajvCustomFormatsRegistry(ajv);
ajvCustomKeywordsRegistry(ajv);

Keywords

decimalPrecision

This Keyword works for both string and number values, enforcing strict control over decimal places.

{
  "price": {
    "type": "number",
    "decimalPrecision": 2
  }
}

// Valid: 2, 2.11
// Invalid: 2.123

Formats

uuid

Validates UUID (Universally Unique Identifier).

{
  "id": {
    "type": "string",
    "format": "uuid"
  }
}

// Valid: 'e3ced088-62a2-418b-bda1-d114a37badb3'
// Invalid: 'e3ced088-62a2-418b-bda1-d114a'

india-PAN

Validates Indian PAN number.

{
  "pan": {
    "type": "string",
    "format": "india-PAN"
  }
}

// Valid: 'HNEPS8362B'
// Invalid: 'PT12H'

india-IFSC

Validates Indian IFSC code.

{
  "ifsc": {
    "type": "string",
    "format": "india-IFSC"
  }
}

// Valid: 'SBIN0001234'
// Invalid: 'PT12H'

india-pincode

Validates Indian PIN code.

{
  "pincode": {
    "type": "string",
    "format": "india-pincode"
  }
}

// Valid: '516501'
// Invalid: 'PT12H'

udyam

Validates Udyam registration ID.

{
  "udyam": {
    "type": "string",
    "format": "udyam"
  }
}

// Valid: 'Udyam-12-34-1234567'
// Invalid: 'e3ced088-62a2-418b-bda1-d114a'

positive-number-in-string

Validates positive numbers as strings.

{
  "price": {
    "type": "string",
    "format": "positive-number-in-string"
  }
}

// Valid: '123'
// Invalid: '-123'

utc-date-time

Validates UTC date and time.

{
  "timestamp": {
    "type": "string",
    "format": "utc-date-time"
  }
}

// Valid: '2024-09-21T14:30:00Z'
// Invalid: '12/09/2023'

iso8601-duration

Validates ISO 8601 duration format.

{
  "duration": {
    "type": "string",
    "format": "iso8601-duration"
  }
}

// Valid: 'PT13D'
// Invalid: 'PT12H'

Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

Sponsor & Support

To keep this library maintained and up-to-date, please consider sponsoring it on GitHub.

Or, if you're looking for private support or help in customizing the experience, reach out to us at [email protected]

About MEDHIRA

MEDHIRA - Engineering Intelligence Across Everything


License

Apache-2.0


Made with passion by MEDHIRA