validator.js Logo

validator.js

A library of string validators and sanitizers.

23,588
Application Security
Free
Visit website
0

validator.js Description

This library validates and sanitizes strings only. If you're not sure if your input is a string, coerce it using input + ''. Passing anything other than a string will result in an error. Installation and Usage Server-side usage Install the library with npm install validator No ES6 var validator = require('validator'); validator.isEmail('foo@bar.com'); //=> true ES6 import validator from 'validator'; Or, import only a subset of the library: import isEmail from 'validator/lib/isEmail'; Tree-shakeable ES imports import isEmail from 'validator/es/lib/isEmail'; Client-side usage The library can be loaded either as a standalone script, or through an AMD-compatible loader <script type="text/javascript" src="validator.min.js"></script> <script type="text/javascript"> validator.isEmail('foo@bar.com'); //=> true </script> The library can also be installed through bower $ bower install validator-js CDN <script src="https://unpkg.com/validator@latest/validator.min.js"></script> Validators Here is a list of the validators currently available. Validator Description contains(str, seed [, options]) check if the string contain

FEATURED

Proton Pass Logo

Password manager with end-to-end encryption and identity protection features

NordVPN Logo

VPN service providing encrypted internet connections and privacy protection

Mandos Fractional CISO Services Logo

Fractional CISO services for B2B companies to accelerate sales and compliance

Stay Updated with Mandos Brief

Get the latest cybersecurity updates in your inbox

POPULAR

RoboShadow Logo

A cybersecurity platform that offers vulnerability scanning, Windows Defender and 3rd party AV management, and MFA compliance reporting, among other features.

10
TestSavantAI Logo

Security platform that provides protection, monitoring and governance for enterprise generative AI applications and LLMs against various threats including prompt injection and data poisoning.

5
Cybersec Feeds Logo

A threat intelligence aggregation service that consolidates and summarizes security updates from multiple sources to provide comprehensive cybersecurity situational awareness.

5
Fabric Platform by BlackStork Logo

Fabric Platform is a cybersecurity reporting solution that automates and standardizes report generation, offering a private-cloud platform, open-source tools, and community-supported templates.

5
Mandos Brief Newsletter Logo

A weekly newsletter providing cybersecurity leadership insights, industry updates, and strategic guidance for security professionals advancing to management positions.

5
View Popular Tools →