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

@selahattinunlu/node-validator

v1.0.2

Published

Nodejs Validator Package

Downloads

10

Readme

It uses poppinss/indicative in under the hood. indicative does not provide any configuration chance for default error messages. And also it does not provide to change attributes. So, I just wrap it and made it configurable.

There was a feature request about it but maintainer of indicative declined it. (This issue: #59) Maintainer said "you can wrap and configure it". I did it but I don't want to copy the wrapper code in every project. That's why I published it as a npm package.

Finally, I need to say last thing, I like "indicative" package so much. Thanks to maintainer of that package! I hope the maintainer will add configuration to built in feature!

Installation

npm install @selahattinunlu/node-validator -S

Usage

Configuration

You can configure default message and default attributes by passing options parameters while initialize it

const Validator = require('@selahattinunlu/node-validator');

const validator = new Validator({
  messages: {
     require: '{{ field }} is required.',
     email: 'Please enter a valid email',
  },
  attributes: {
    email: 'Email',
  }
});

or you can set default messages and default attributes using setter functions.

const Validator = require('@selahattinunlu/node-validator');

const validator = new Validator();

validator.setDefaultMessages({
  //
});

validator.setDefaultAttributes({
  //
});

Validation

const Validator = require('@selahattinunlu/node-validator');

const validator = new Validator();

const exampleData = {
   name: 'Selahattin'
};

const options = {
  messages: {
    required: 'This field is required.',
  },
  attributes: {
    name: 'Name'
  }
}

validator
  .validate(exampleData, {
    name: 'required',
    email: 'required|email',
  }, options)
  .then(() => console.log('everything is okay!'))
  .catch(errors => console.log(errors));

Validation Rules

As I said before, this package uses poppinss/indicative in under the hood. So you need to check that package's documenatation to learn all rules. Please click here to access documentation.