
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
validate-data
Advanced tools
NodeJs backend library for validate data against the rules provided.
Install the library with npm install validate-data
const validate = require('validate-data');
// Validation rules
const rules = {
required: "email name age",
email: "email",
string: "email name",
number: "age",
array: "options",
boolean: "status"
};
// Data to be validated
const data = {
email: "example@sample.com",
name: "John",
age: 25,
options: [1,2,3],
status: true
};
// Using the package
let error = validate(data, rules);
console.log(error);
Error will be null if all the validation rules passs, otherwise will get the following error
[
{
rule: 'required', // Failed rule
errorOn: ['sample'] // Failed data fields
},
{
rule: 'email',
errorOn: ['email']
},
{
rule: 'number',
errorOn: ['age']
},
{
rule: 'array',
errorOn: ['options']
},
{
rule: 'boolean',
errorOn: ['status']
}
]
Module ensure that the given data will be validated against the following strategies.
Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. Please provide as much detail and context as possible. Click here to add feature requests and issues.
yarn run test
MIT
[v0.1.1] - 2017-07-19
FAQs
Sanitize and validate data with the given set of rules.
The npm package validate-data receives a total of 62 weekly downloads. As such, validate-data popularity was classified as not popular.
We found that validate-data 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.