npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@justinc/all-included-validator

v1.0.0

Published

Checks that all elements in the given 2nd iterable are members of the given 1st iterable

Readme

all-included-validator Build status NPM version License Semantic Release Js Standard Style

Install

npm i @justinc/all-included-validator

Demo

(look at tests for more examples)

// NOTE: run  `node repl.js` to see this in action:
const allIncluded = require('@justinc/all-included-validator')

const ids = [1, 2, 3, 4, 5]
const refs = [1, 2]
const nums = [2, 4, 2, 3, 1]
const over9000s = [9001, 9002]

const allIncludedInIds = allIncluded(ids)
const allIncludedInOver9000s = allIncluded(over9000s)

console.log(allIncludedInIds(refs)('The following refs are not in ids: '))
// [ true, [] ]

console.log(allIncludedInIds(nums)())
// [true, [] ]

const allOver9000sIncludedInIds = allIncludedInIds(over9000s)
console.log(allOver9000sIncludedInIds('The following are not in ids: '))
// [ false, [ new Error('The following are not in ids: 9001, 9002') ]]

console.log(allOver9000sIncludedInIds('Ids knows not of these: '))
// [ false, [ new Error('Ids knows not of these: 9001, 9002') ]]

console.log(allIncludedInOver9000s(ids)(`These ids aren't even over 9000: `))
// [ false, [ new Error(`These ids aren't even over 9000: : 1, 2, 3, 4, 5`) ]]

combine-validations

If you're OK with using Folktale Validation, you might be interested in combine-validations.

To use this package with combine-validations you will need to convert its output Tuple<Boolean, Array<Error>> to a Folktale Validation with something like this:

const Validation = require('data.validation')
const allIncluded = require('@justinc/all-included-validator')
const combineValidations = require('@justinc/combine-validations')

const { Success, Failure } = Validation

const asValidation = ([isValid, errors]) => isValid ? Success(true) : Failure(errors)

const ids = ['node1', 'node2', 'node3']
const dependencies = [ 'node1', 'node3' ]
const validation = combineValidations([
  asValidation(allIncluded(ids)(dependencies)())
])

Tutorials

TODO: A JSDoc 3 tutorial (re currying) needs to be injected in this README.md. For now there's only a link:

Modules

@justinc/all-included-validator

@justinc/all-included-validator~allIncluded([iterableA], [iterableB], [errMsgPrefix]) ⇒ Tuple.<Boolean, Array.<Error>>

This function is curried. Checks that all elements in the given 2nd iterable are members of the given 1st iterable.

Kind: inner method of @justinc/all-included-validator
See: Tuple

| Param | Type | Default | Description | | --- | --- | --- | --- | | [iterableA] | Iterable | [] | The 1st iterable | | [iterableB] | Iterable | [] | The 2nd iterable, whose elements should all be in the 1st iterable | | [errMsgPrefix] | String | '' | A string to prefix the error message (the err msg is any found 2nd iterable elems which are not in the 1st iterable) |

@justinc/jsdocs

This module houses JSDoc 3 type definitions which can be re-used in different packages.

@justinc/jsdocs.Tuple : Array

The type Tuple is an Array of fixed length whose elements at specific indices are of the specified types.

Kind: static typedef of @justinc/jsdocs
Example

// A Tuple of arity (length) 2, whose first el is a Boolean and second el is
// an Array of Error:
Tuple<Boolean, Array<Error>>
// e.g. [ true, [] ]
// e.g. [ false, [ new Error('computer says no') ] ]

Example

// A Tuple of arity (length) 3, whose first el is a String, and both the
// second and third els are an Array of String:
Tuple<String, Array<String>, Array<String>>
// e.g. [ 'hello', [ 'world' ], [ 'goodbye', 'world' ] ]