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

@timche/varlock-require-all-or-none

v0.1.1

Published

Varlock plugin adding @requireAllOrNone, which fails the load when only some items of a group are set

Readme

@timche/varlock-require-all-or-none

A varlock plugin adding @requireAllOrNone, a root decorator that fails the load when only some items of a group are set.

Useful for a set of values that is optional as a whole but useless in part, such as the client id, secret and tenant of an optional sign-in provider. Writing each item as @required=not(isEmpty(...)) of the others is rejected as a dependency cycle, and anchoring on one item only checks one direction.

Install

npm install --save-dev @timche/varlock-require-all-or-none

Usage

# @plugin(@timche/varlock-require-all-or-none)
# @requireAllOrNone($CLIENT_ID, $CLIENT_SECRET, $TENANT_ID)
# @requireAllOrNone($SMTP_HOST, $SMTP_PASSWORD)
# ---
# @optional
CLIENT_ID=
# @optional @sensitive
CLIENT_SECRET=
# @optional
TENANT_ID=
# @optional
SMTP_HOST=
# @optional @sensitive
SMTP_PASSWORD=

Setting none or all of a group passes. Setting some fails the load, naming what is missing and what is set:

- ❌ CLIENT_SECRET must be set because CLIENT_ID and TENANT_ID are set
  Set all of CLIENT_ID, CLIENT_SECRET and TENANT_ID, or none of them

Rules

  • An item is set when its resolved value is neither undefined nor an empty string. 0 and false count as set.
  • Use it once per group; each group is checked on its own, and one item may belong to several groups.
  • Each argument must be an item reference ($KEY), with at least 2 different items.
  • An item that fails to resolve on its own reports its own error, and its group is not checked.
  • The items keep their own @optional or @required, so generated types do not change.

Ordering

Varlock resolves the items of a root decorator when it reaches that decorator in the header. If an item's value comes from a plugin that is initialized by another root decorator, such as op() after @initOp, put @requireAllOrNone after it:

# @plugin(@varlock/1password-plugin)
# @plugin(@timche/varlock-require-all-or-none)
# @initOp(token=$OP_TOKEN)
# @requireAllOrNone($CLIENT_ID, $CLIENT_SECRET)

License

MIT