Gathering detailed insights and metrics for @lysyi3m/stimulus-use-validation
Gathering detailed insights and metrics for @lysyi3m/stimulus-use-validation
Gathering detailed insights and metrics for @lysyi3m/stimulus-use-validation
Gathering detailed insights and metrics for @lysyi3m/stimulus-use-validation
Lightweight, zero dependency, customizable mixin for Stimulus to handle form validation easily. Heavily rely on Constraint Validation API with support for custom validators.
npm install @lysyi3m/stimulus-use-validation
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
3 Stars
49 Commits
2 Watchers
2 Branches
1 Contributors
Updated on Apr 28, 2024
Latest Version
1.3.0
Package Id
@lysyi3m/stimulus-use-validation@1.3.0
Unpacked Size
14.14 kB
Size
4.56 kB
File Count
6
NPM Version
6.13.4
Node Version
12.16.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
20
Lightweight, zero dependency, customizable mixin for Stimulus to handle form validation easily. Heavily rely on Constraint Validation API with support for custom validators.
1$ npm install --save @lysyi3m/stimulus-use-validation
or using Yarn:
1$ yarn add @lysyi3m/stimulus-use-validation
1import { Controller } from 'stimulus' 2import useValidation from '@lysyi3m/stimulus-use-validation' 3 4export default class extends Controller { 5 connect() { 6 useValidation(this, { 7 // options 8 }) 9 } 10}
Option | Description | Default value |
---|---|---|
disable | Disable submit button if there are any errors | true |
errorClassName | Class name attached to invalid form control | "" |
errorSelector | Selector to match DOM element, where validation message will be rendered | .help-block |
form | HTMLElement which form validation will be attached to. this.element if not specified | undefined |
parentErrorClassName | Class name attached to DOM element, containing invalid form control | has-error |
parentSelector | Selector to match DOM element, contain form control and error container elements | .form-group |
validators | Custom validators, mapped like '[field_name]': validatorFunc | {} |
Custom validators are functions, which accept two arguments: field
and form
(useful for complex validations implementation, based on several form fields) and return an object like { isValid: Bool, message: String }
Example:
1 2const customPasswordValidator = (field, form) => { 3 const isValid = field.value !== 'password' 4 5 const message = "Password should not be 'password'" 6 7 return { isValid, message } 8} 9
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/4 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
14 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More