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

ryv

v1.0.4

Published

## Sobre

Readme

Vanilla Parsley

Sobre

Validation lib using VanillaJS, based on ParsleyJS. Currently WIP.

Constructor

const nameValidator = new VanillaParsley({
  targetElement: '#name'
})

Options

targetElement: String, HTMLElement (obligatory)

Defines which element should be validated.

  • Possible values: String, HTML Element (Single element for now)
// Validates the element with id 'name'
const nameValidator = new VanillaParsley({
  targetElement: '#name',
});

// Validates the element with id 'age'
const ageValidator = new VanillaParsley({
  targetElement: document.getElementById('age'),
});

validationTriggers: Array

Array containing a list of events that should be used to trigger the validation on the input field.

Default: ['blur', 'keyup']

const nameValidator = new VanillaParsley({
  targetElement: '#name',
  validationTriggers: ["blur", "keydown", "focusin"]',
});

errorIcon: String

String containing a SVG to be used as the error icon to display. Must have the class validation__error-icon

Default: <svg xmlns="http://www.w3.org/2000/svg" class="validation__error-icon icon icon-tabler icon-tabler-x" width="44" height="44" viewBox="0 0 24 24" stroke-width="5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z"/> <line x1="18" y1="6" x2="6" y2="18" /> <line x1="6" y1="6" x2="18" y2="18" /> </svg>

Methods

addCustomValidator({validatorSettings})

Adds a new custom validator. validatorSettings must follow the format:

// valueToCheck: Value of the field being validated
// attributeValue: Value set on the attribute of the validator.
// validationMethod: Function to be used in the validation. If it returns true, the current input is validated.
// errorMessage: Function that returns the error message if the current input is invalid.

validatorSettings: {
  minlength: {
   validationMethod(valueToCheck, attributeValue) {
    if (valueToCheck.length >= parseInt(attributeValue)) return true;
    else return false;
   },
   errorMessage(attributeValue) {
    return `Minimum of ${attributeValue} characters`;
   },
  },
},

Example of a custom validator for a full name (Minimum of 2 words of 3 characters each):

new VanillaParsley({
  targetElement: '#name',
 }).addCustomValidator({
  fullname: {
   validationMethod(valueToCheck) {
    const regex = /^([A-zÀ-ú '´]{3,})+\s+([A-zÀ-ú '´]{3,})$/g;
    if (regex.test(valueToCheck)) return true;
    return false;
   },
   errorMessage() {
    return `Type your full name`;
   },
  },
 });