Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
@saimulhasnain-dev/input-validator
Advanced tools
Human-friendly and powerful data validator library for JavaScript
Human-friendly and powerful data validator library for JavaScript
This project requires NodeJS (version 8 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.
$ npm -v && node -v
6.4.1
v8.16.0
These instructions will help you to install this package in your project to perform data validation.
BEFORE YOU INSTALL: please read the prerequisites
Start with installation of package in your project:
$ cd PROJECT
$ npm i @saimulhasnain-dev/input-validator
After successful installation of package you need to import package in your file: To import complete package in once
$ import validator from '@saimulhasnain-dev/input-validator';
Or if you prefer using any particular function then:
$ import { isAlphabet } from '@saimulhasnain-dev/input-validator';
import validator from '@saimulhasnain-dev/input-validator';
let res = validator.isAlphabet('abc');//to verify string contains alphabet
console.log(res); // it will print `true` as it contains alphabet
validator.isStrongPassword('Qwert@!2313');//to check password strength
Accessing only required function
import { isValidEmail } from '@saimulhasnain-dev/input-validator';
isValidEmail('abc@gmail.com');//to test email is valid or not
import { getValueFromObject, isKeyExistsNested } from '@saimulhasnain-dev/input-validator';
const user = {
name: "abc",
email: "xyz@email.com",
address: {
state: "New york",
country: "USA",
phones: {
primary: "+1234567890",
secondary: "+0987654321"
}
}
}
getValueFromObject(user, ["address", "state"]);//to get value of `state` key inside `address` object
getValueFromObject(user, ["address", "phones","primary"])////to get value of `primary` key inside `phone` object inside `address`
isKeyExistsNested(user, "address", "phones","primary");// to check if key `primary` exists in this object or not
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
git checkout -b my-new-feature
git add .
git commit -am 'Add some feature'
git push origin my-new-feature
All credit goes to me:sunglasses:
We use SemVer for versioning. For the versions available, see the tags on this repository.
FAQs
Human-friendly and powerful data validator library utility for JavaScript
The npm package @saimulhasnain-dev/input-validator receives a total of 2 weekly downloads. As such, @saimulhasnain-dev/input-validator popularity was classified as not popular.
We found that @saimulhasnain-dev/input-validator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.