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

validatorcraft

v1.0.0

Published

A lightweight, dependency-free JavaScript validation library for Node.js.

Downloads

147

Readme

validatorcraft

A lightweight, zero-dependency JavaScript validation library for Node.js.

Features

  • Zero Dependencies: Lightweight and fast.
  • Node.js Ready: Works with Node >= 18.
  • Pure Functions: Returns only booleans, throws no unnecessary exceptions.
  • Comprehensive: Validate emails, phones, passwords, UUIDs, hex colors, and more.

Installation

npm install validatorcraft

Usage

const validator = require('validatorcraft');

// Email Validation
validator.isEmail('[email protected]'); // true

// Phone Validation
validator.isPhone('+1234567890'); // true

// Password Validation
validator.isStrongPassword('StrongP@ssw0rd'); // true

// Hex Color
validator.isHexColor('#ffffff'); // true

// Length checks
validator.betweenLength('hello', 3, 10); // true

API Reference

isEmail(email)

Validates proper email format.

  • Returns: boolean

isPhone(phone)

Validates phone numbers, including international numbers beginning with +.

  • Returns: boolean

isStrongPassword(password)

Validates passwords based on strong criteria:

  • Minimum 8 characters
  • At least one uppercase letter
  • At least one lowercase letter
  • At least one number
  • At least one special character
  • Returns: boolean

isUsername(username)

Validates a username based on:

  • 3–20 characters long
  • Contains only letters, numbers, and underscores
  • Returns: boolean

isURL(url)

Validates standard http and https URLs.

  • Returns: boolean

isNumeric(value)

Returns true only if the string contains digits.

  • Returns: boolean

isAlpha(value)

Returns true only if the string contains alphabetic characters.

  • Returns: boolean

isAlphaNumeric(value)

Returns true only if the string contains alphanumeric characters.

  • Returns: boolean

isEmpty(value)

Returns true for "", null, and undefined.

  • Returns: boolean

minLength(str, len)

Checks if the string length is at least len.

  • Returns: boolean

maxLength(str, len)

Checks if the string length is at most len.

  • Returns: boolean

betweenLength(str, min, max)

Checks if the string length is between min and max (inclusive).

  • Returns: boolean

isJSON(str)

Checks if a string is valid JSON.

  • Returns: boolean

isUUID(str)

Checks if a string is a valid UUID v4.

  • Returns: boolean

isHexColor(color)

Checks if a string is a valid hex color (e.g., #fff, #000000).

  • Returns: boolean

isDate(date)

Checks if a string is a valid ISO date.

  • Returns: boolean

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.