Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
nosix.js abstracts input validation, making it easier and straighforward for you to validate any type of input.
You run nosix by providing a list of validator functions and an input. nosix will test the input against the validators and return the results.
If the input fails to pass one of more validators, the result will be an object with the validation errors. You can initialize nosix.js with a set of validators and add/remove validators at run time.
By default, Nosix works async. You may also run Nosix in a sync mode.
npm install nosix
const nosix = require('nosix');
const fn1 = input => typeof input == 'string' ? true : `${input} must be a string`;
const fn2 = input => input != '' ? true : `${input} cannot be empty`;
const stringInput = "a random string";
const objInput = { random: "object" };
// validate async
nosix.validate(stringInput, [fn1, fn2], err => {
if(!err) console.log('validation OK'); // validation OK
});
// validate sync
const err = validateSync(objectInput, [fn1, fn2]);
console.log(err); // [ '[Object object] must be a string' ]
The returned object err
is null if there was no validation errors. Otherwise
the returned value is an array with all validation errors.
MIT © Gonçalo Pestana
FAQs
Input validation module
We found that nosix 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
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.