
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
simple-validate
Advanced tools
Simple argument validator.
$ npm install simple-validate
Run the specs
$ jasmine-node spec/
var validate = require('simple-validate');
var pattern = {
title : validate.required(isString)
description : validate.isAll(isString, hasLengthGreaterThan(5)),
isActive : isBoolean,
tags : isArray
};
validate(pattern, {
title : 'Hi There',
description : 'This is a great post.',
isActive : true
// tags are undefined - but that is ok, validator treats them as optional
});
// => true
The validator runs each argument against the defined validation pattern, asserting a true outcome for each. Properties defined in the validation pattern are assumed to be optional unless declared otherwise.
Note, this module is best used with a functional library to provide predicates (isString, isNull, etc.), such as lodash or ramda.
A more advanced example can also be found in the examples directory.
Object -> Object -> Boolean
Validates arguments against the provided pattern.
validate(<pattern>, <args>) -> Boolean
Note: all logical utilities must be called incrementally (fn(v1)(v2)) as shown in the examples below.
Predicate -> Predicate
Returns a predicate that is satisfied if the supplied predicate is satisfied and the provided value is not undefined. This should be used to denote that a property is required, since otherwise properties as assumed to be optional.
validate.required(p) -> Function
validate.required(p)(<value>) -> Boolean
Predicate -> Predicate
Returns a predicate that is satisfied if the supplied predicate is satisfied or the provided value is undefined. Note: using this utility is probably not necessary to use often, since validate assumes all properties are optional by default. This is the shorthand equivalent to isAny(isUndefined, p).
validate.optional(p) -> Function
validate.optional(p)(<value>) -> Boolean
Predicates -> Predicate
Returns a predicate that is satisfied if all supplied predicates are satisfied for the provided value.
validate.isAll(p1, p2, ...) -> Function
validate.isAll(p1, p2, ...)(<value>) -> Boolean
Predicates -> Predicate
Returns a predicate that is satisfied if any of the supplied predicates are satisfied for the provided value.
validate.isAny(p1, p2, ...) -> Function
validate.isAny(p1, p2, ...)(<value>) -> Boolean
Predicate -> Predicate
Returns a predicate that inverts the supplied predicate.
validate.isNot(p) -> Function
validate.isNot(p)(<value>) -> Boolean
validate.withErrors(<pattern>, <values>). Consider adding getErrors, etc. Will probably include helper method to map pattern values for general usage.git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)FAQs
Simple object validator.
We found that simple-validate 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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.