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 🙏

© 2025 – Pkg Stats / Ryan Hefner

djvalidatorvue

v1.0.2

Published

The best and simplest model based validator for Vue 3, UI independent and no dependency

Readme

DjValidatorVue - Form model based validation for Vue3

Version 1

THE SIMPLEST VUE VALIDATION LIBRARY!

DjValidatorVue is the most simple, flexible and quick to use library for vue validation, it does not depend on any UI. Available in English, Russian and Spanish.

Features

  • Model based validator
  • Simple and quick validation rules
  • Minimum code
  • Integration with any type of vue project
  • Optional custom component for messages
  • You can create your own validators
  • Without dependency
  • UI independent

SHOW DEMO HERE!!!

Install

npm install djvalidatorvue --save

Import

import {validate} from 'djvalidatorvue'

Using

//object to validate (simple object or reactive)
let mi_obj=reactive({
	email:"",
	username: "",
	password: "",
	obs:""
})

//declare object with validation instructions
const validations={
	email:{rule:'email,50'}, 
	obs:{req:true,rule:'text,5,150'},
	username:{req:true,rule:'word,4,20'},
	password:{req:true,rule:'word,6,20',msg:'invalid password'},
}

//declare object to contain errors
let errors=reactive({})

//To validate, use the validate method
function save(){
	let resp=validate(mi_obj,validations,errors)
	alert(resp)//true or false
}

//errors contains invalid feedback, to show:
<input type="text" v-model="mi_obj.email">
<span class="error" v-if="errors.email">{{errors.email}}</span>

//You can also use the built-in component (import {DjError} from 'djvalidatorvue')
<input type="text" v-model="mi_obj.email">
<DjError :error="errors.email"/>

SHOW THE FULL DOCUMENTATION

Other uses:

You can validate just one field with validate_field, and it can be run attached to events like @blur.

//Validate only a field
import {validate_field} from 'djvalidatorvue'

function validate_email(){
	let resp=validate_field('email',mi_obj,validations,errors)
	//actions
}

<input type="text" v-model="mi_obj.email" @blur="validate_email">
<DjError :error="errors.email"/>
		

You can also validate individual variables with validate_var.

import {validate_var} from 'djvalidatorvue'
let error=ref(null)
funciton check(texto){
	validate_var(texto,{req:true,rule:'text,5,150'},error)
}

Clear errors:

To clear errors and stop displaying them you can use clean_errors.

import {clean_errors} from 'djvalidatorvue'

let errors=reactive({})

function open_form(){
	clean_errors(errors)
}

Or empty the errors object manually

Change validation message:

Add 'msg' in the validations object.

const validations={
	username:{req:true,rule:'word,4,20'},
	password:{req:true,rule:'word,6,20',msg:'invalid password'},
}

Error component style:

There are 2 css variables to change the style of the error message:

--dj-validator-error-color
--dj-validator-text-size

Add own validations:

With regular expressions:

const validations={
	mi_field:{req:true,rule:'regexp,^[aeiou]+$,i'},
}

With own functions:

const validations={
	mi_field:{req:true,rule:'call',func:isUpperCase},
}

function isUpperCase(value,params){
	return value==value.toUpperCase()
}

Adding a new rule:

import {add_validator} from 'djvalidatorvue'

add_validator('upper',isUpperCase,'text is not uppercase')

function isUpperCase(value,params){
	return value==value.toUpperCase()
}

const validations={
	mi_field:{req:true,rule:'upper'},
}

Documentation:

SHOW THE FULL DOCUMENTATION

Author

DjValidatorVue was written by David Esneyder Jerez Garnica.

Linkedin

[email protected]

License

Copyright (c) 2025 David Esneyder Jerez Garnica. Released under the GPL v3 license.