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

@ebdev/ngx-smart-validators

v0.0.3

Published

Comprehensive, tree-shakeable validators for Angular reactive and template-driven forms.

Readme

@ebdev/ngx-smart-validators

Comprehensive, tree-shakeable validation for Angular 17–22. It supports reactive forms and template-driven forms, ships readable error messages, and has no setup requirement for the free validator set.

Install

npm install @ebdev/ngx-smart-validators

Reactive forms

import { FormControl, FormGroup } from '@angular/forms';
import {
  matchFields,
  password,
  phone,
  requiredTrimmed,
  strictEmail,
} from '@ebdev/ngx-smart-validators';

readonly form = new FormGroup(
  {
    email: new FormControl('', [requiredTrimmed(), strictEmail()]),
    phone: new FormControl('', [phone('IL')]),
    password: new FormControl('', [password({ minLength: 10, special: true })]),
    confirmPassword: new FormControl(''),
  },
  { validators: matchFields('password', 'confirmPassword') },
);

Validators intentionally ignore empty values unless they enforce requiredness, so they compose cleanly with Angular's Validators.required.

Template-driven forms

Import individual standalone directives, or NGV_DIRECTIVES:

@Component({
  standalone: true,
  imports: [FormsModule, NGV_DIRECTIVES, NgvMessagePipe],
})
export class ProfileComponent {}
<input name="email" [(ngModel)]="email" ngvRequiredTrimmed ngvStrictEmail
       #emailModel="ngModel">
<small>{{ emailModel.errors | ngvMessage }}</small>

Configure messages and a Pro license

import { ApplicationConfig } from '@angular/core';
import { provideSmartValidators } from '@ebdev/ngx-smart-validators';

export const appConfig: ApplicationConfig = {
  providers: [
    provideSmartValidators({
      licenseKey: environment.smartValidatorsLicense,
      messages: { strictEmail: 'Enter a work email address.' },
    }),
  ],
};

License verification is offline. Signed keys may be restricted by hostname and expiry date; local development hosts always work. An invalid or expired key falls back to the free tier without breaking the form.

Validator catalog

Free

  • Basics: requiredTrimmed, range, number, integer, decimal, greaterThan, lessThan, alpha, alphanumeric, noWhitespace
  • Strings: regex, startsWith, endsWith, includes, url, strictEmail
  • Dates: validDate, minDate, maxDate, pastDate, futureDate
  • Formats: phone, uuid, json, base64, hexColor, ipAddress, latitude, longitude
  • Groups and utilities: matchFields, withMessage

Pro

  • Configurable password rule engine
  • creditCard with Luhn checking and card-brand detection, and iban
  • minAge and maxAge
  • dateRange, requiredIf, atLeastOne, and allOrNone
  • Accurate international phoneNumber from @ebdev/ngx-smart-validators/phone

Install libphonenumber-js when using the optional phone entry point:

npm install libphonenumber-js
import { phoneNumber } from '@ebdev/ngx-smart-validators/phone';

Error shape

Every validator returns Angular ValidationErrors using a predictable object:

{
  minDate: {
    actual: '2025-01-01',
    min: '2026-01-01',
    message: 'Date must be on or after 2026-01-01.'
  }
}

Use withMessage(validator, 'Custom message') for one control, or configure global messages with provideSmartValidators.

Compatibility

| Package | Supported Angular | | --- | --- | | @ebdev/ngx-smart-validators 0.x | 17, 18, 19, 20, 21, 22 |

The package is published in Angular partial-Ivy format.

License

The free tier may be used in commercial applications. Pro validators require a purchased signed key. See the bundled license agreement for complete terms.