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 🙏

© 2024 – Pkg Stats / Ryan Hefner

vuejs-model-validator

v1.1.0

Published

Vuejs validator of component data

Downloads

23

Readme

This is a data validator inspired by https://github.com/yiminghe/async-validator and adapted to VueJS fixing the lack of other data validators and with the following features:

Template agnostic

No matter what template library you use, this validator will simply work.

Simplicity in custom validations

Focused in developer easiness to save time and headaches.

Maintain validations reactivity when data replaced

When an object is loaded from server you can set it without worring, it will restore attribute watchers.

Data tree support (objects and array of objects)

If you have nested data objects to validate, this mixin will deal with it without trouble.

Very simple logic performing validations by order and skipping the rest when validation fails

If a validation in value fails will not run the rest of validations for the value, reducing time and processing considerably.

Support for promises

Will detect if the returned validation is a promise and handle properly without need of external packages.

Real time results

I have found that in some validators the results are showed in the next tick. This mixin forces the render to be updated once the validations are finished so no delays on result are produced.

Multiple async validations will be controlled and only last one will be taken

If a typing is being validated against a resource it will control the times in order to ensure that the last one is the validation that prevails against the previuos.

Do not revalidate a value already validated

It controls whether a validation is performed or not, so if the value does not change it will not be validated again, saving time and processing.

Dependencies free, being ~25 KB minified

This validator is served as a mixin just with vue as dependency in order to reduce the processing, time and load. It is set out to accomplish most of the use cases so it is adapted to common use needs.

Community open

Feel free to contribute or bring suggestions, any improvement will be at least taken in mind, discussed and accepted if reasonable, just keep the the previous rules in mind.

Documentation

Please visit our wiki that we bother to keep updated to know everything about this component: https://github.com/deulos/vuejs-model-validator/wiki