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

@manufosela/form-validators

v1.0.0

Published

Pure deterministic predicates for common form-field validation: email, URL, phones, Spanish documents (NIF/NIE/CIF), banking (IBAN-style account, credit card), dates, postal codes and more. Zero dependencies, zero DOM access.

Readme

@manufosela/form-validators

Library. Pure deterministic predicates and normalizers for common form-field validation. Zero dependencies, zero DOM access. MIT-licensed.

Each validator is a named export that takes a value and returns a boolean. Each validator also has a paired normalize<Name>(value) function that returns the canonical form (trim + format-specific cleanup like stripping country code from phones, lowercasing emails, uppercasing Spanish documents, etc.). Designed to be the validation core of UI libraries (automatic_form_validation, @manufosela/ai-form) and of any custom form code.

Install

npm install @manufosela/form-validators

Usage

import { email, mobileEs, nif, creditCard } from '@manufosela/form-validators';

email('[email protected]'); // true
mobileEs('600 000 000'); // true
nif('12345678Z'); // true (control letter checked)
creditCard('4111111111111111'); // true (Luhn-checked)

Normalizers

Pair each validator with normalize<Name>(value) to get the canonical form before storing:

import { normalizeMobileEs, normalizeEmail, normalizeNif } from '@manufosela/form-validators';

normalizeMobileEs('+34 639 01 89 87'); // '639018987'
normalizeEmail(' [email protected] '); // '[email protected]'
normalizeNif(' 12345678z '); // '12345678Z'

Compose normalize then validate for the typical "clean and check" pipeline:

import { normalizeMobileEs, mobileEs } from '@manufosela/form-validators';
const value = normalizeMobileEs(rawInput);
if (mobileEs(value)) save(value); // store the canonical form

Lookup by name

For dynamic dispatch (e.g. from a data-tovalidate attribute), use validate(name) and normalize(name):

import { validate, normalize } from '@manufosela/form-validators';

const fn = validate('movil');
const clean = normalize('movil');
fn(clean('+34 600 000 000')); // → true, value stored as '600000000'

Both lookups are case-insensitive and accept every alias from the legacy automatic_form_validation library: mobile, movil, nummovil, email, correo, nif, cif, nie, cuentabancaria, creditcard, tarjetacredito, etc. normalize(name) of an unknown name returns a safe trim-only fallback so callers never need to null-check.

Validator catalogue

| Category | Validators | Normalizer canonicalises | | -------- | ---------- | ------------------------ | | Numeric | integer, float, number | trim + accept comma decimal | | Text | alpha, alphaWithDash, alphanumeric, alphanumericWithSpace | trim + collapse internal whitespace | | Date | date(value, mode?) — mode 'dmy' (default), 'mdy', 'ymd' | dd/mm/yyyy (or yyyy/mm/dd), zero-padded | | File | fileExtension(filename, [".pdf", ".doc"]) | trim only | | Email | email | trim + lowercase + strip whitespace | | URL | url | trim + prepend https:// if missing + lowercase scheme/host | | Phones | mobileEs, landlineEs, telephoneEs, postalCodeEs, iccid | trim + strip separators + strip +34/0034/34 country prefix | | Spanish documents | nif, nie, cif, bankAccountEs (CCC) | trim + uppercase + strip separators | | Banking | creditCard (Luhn) | trim + strip spaces/hyphens/dots |

Versioning

Project policy: semver from 1.0.0. There is no 0.x phase — when something is released, it's released. Breaking changes bump major. The first release of this package was 1.0.0 even though the catalogue had been previously available as a sub-module of [email protected].

Origin

The catalogue was extracted from Automatic-Form-Validation (Apache-2.0) and relicensed by the original author to MIT for broader reuse. The source library now consumes this package internally.

License

MIT © Mánu Fosela