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 🙏

© 2025 – Pkg Stats / Ryan Hefner

validme

v1.0.1

Published

A comprehensive validation library for various data types.

Downloads

116

Readme

This documentation provides an overview of all the functions available in the validme package, categorized into different sections. Each function is described along with its purpose and parameters.

Package Information

Table of Contents


Basic Validations

| Function | Description | Parameters | | ------------- | --------------------------------------------------- | ----------------- | | isRequired | Checks if a value is defined and not empty. | value | | minLength | Validates that a string's length is at least min. | value, min | | maxLength | Validates that a string's length is at most max. | value, max | | exactLength | Validates that a string's length matches length. | value, length | | pattern | Validates a string against a regex pattern. | value, regex |


String Validations

| Function | Description | Parameters | | ------------------ | --------------------------------------------------------- | ---------- | | isEmail | Validates an email address. | value | | isURL | Validates a URL. | value | | isAlpha | Checks if a string contains only alphabets. | value | | isAlphaNumeric | Checks if a string contains only alphanumeric characters. | value | | isSlug | Checks if a string is a valid slug. | value | | isLowercase | Checks if a string is in lowercase. | value | | isUppercase | Checks if a string is in uppercase. | value | | isMixedCase | Checks if a string contains both uppercase and lowercase. | value | | isStrongPassword | Validates if a string is a strong password. | value | | isMediumPassword | Validates if a string is a medium-strength password. | value |


Number Validations

| Function | Description | Parameters | | ------------ | ----------------------------------------- | --------------------- | | isNumeric | Checks if a value is a number. | value | | isInteger | Checks if a value is an integer. | value | | isFloat | Checks if a value is a float. | value | | isPositive | Checks if a value is positive. | value | | isNegative | Checks if a value is negative. | value | | minValue | Validates that a value is at least min. | value, min | | maxValue | Validates that a value is at most max. | value, max | | inRange | Validates that a value is within a range. | value, min, max |


Date/Time Validations

| Function | Description | Parameters | | ------------- | ------------------------------------------------ | --------------- | | isValidDate | Checks if a value is a valid date. | value | | minDate | Checks if a date is on or after a minimum date. | value, min | | maxDate | Checks if a date is on or before a maximum date. | value, max | | beforeDate | Checks if a date is before a specific date. | value, date | | afterDate | Checks if a date is after a specific date. | value, date | | isTime | Checks if a value is a valid time format. | value | | isDateTime | Checks if a value is a valid datetime. | value |


Boolean Validations

| Function | Description | Parameters | | ----------- | ------------------------------- | ---------- | | isBoolean | Checks if a value is a boolean. | value |


Array Validations

| Function | Description | Parameters | | ------------- | ----------------------------------------------------- | ---------------------- | | minItems | Validates that an array has at least min items. | value, min | | maxItems | Validates that an array has at most max items. | value, max | | uniqueItems | Checks if all items in an array are unique. | value | | itemType | Checks if all items in an array satisfy a type check. | value, typeCheckFn |


Object Validations

| Function | Description | Parameters | | ----------------- | -------------------------------------------- | --------------------------- | | hasRequiredKeys | Checks if an object contains required keys. | obj, keys | | keyType | Checks if a key in an object matches a type. | obj, key, typeCheckFn | | hasExactKeys | Checks if an object contains exact keys. | obj, keys | | isEmptyObject | Checks if an object is empty. | obj |


File Validations

| Function | Description | Parameters | | ------------- | ----------------------------------------- | ------------------------ | | isFileType | Checks if a file is of an allowed type. | fileName, extensions | | maxFileSize | Checks if a file size is below a maximum. | fileSize, max | | minFileSize | Checks if a file size is above a minimum. | fileSize, min |


Advanced Validations

| Function | Description | Parameters | | --------------- | ---------------------------------- | ---------- | | isCreditCard | Validates a credit card number. | value | | isUUID | Validates a UUID. | value | | isIPAddress | Validates an IP address. | value | | isMACAddress | Validates a MAC address. | value | | isJSON | Checks if a value is valid JSON. | value | | isHexadecimal | Validates a hexadecimal string. | value | | isBase64 | Validates a Base64-encoded string. | value |