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

@formjourney/plugin-steps-conditional

v0.1.0

Published

Conditional steps plugin for @formjourney/core — activate/remove steps from field values and clear removed step fields automatically

Readme

@formjourney/plugin-steps-conditional

A @formjourney/core plugin that shows or hides steps based on field values. When a step becomes inactive, its fields are cleared automatically, and navigation and submit skip it.

Install

pnpm add @formjourney/plugin-steps-conditional @formjourney/core

Usage

import { createForm } from '@formjourney/core';
import { stepsConditionalPlugin } from '@formjourney/plugin-steps-conditional';

const form = createForm({
  initialValues: {
    needsShipping: false,
    shipping: { address: '', zip: '' },
  },
  steps: [{ id: 'profile' }, { id: 'shipping' }, { id: 'review' }],
}).use(
  stepsConditionalPlugin({
    rules: [
      {
        stepId: 'shipping',
        when: { field: 'needsShipping', filled: true },
        clears: [
          { path: 'shipping.address', resetTo: '' },
          { path: 'shipping.zip', resetTo: '' },
        ],
      },
    ],
  }),
);

While needsShipping is empty, the shipping step is inactive: form.conditionalSteps.activeStepIds() returns ['profile', 'review'], and goNextActive / submit skip it. Set needsShipping and the step reappears; clear it again and the two shipping fields reset.

Conditions

{ field: 'needsShipping', filled: true }   // truthy / non-empty
{ field: 'plan', equals: 'pro' }           // strict equality (arrays match by includes)

API on the form

form.conditionalSteps.activeStepIds(); // ids of currently active steps
form.conditionalSteps.isActive('shipping'); // boolean
form.conditionalSteps.sync(); // force a re-evaluation

The plugin also feeds the core's active-step resolver, so form.steps.activeStepIds(), goNextActive, goPrevActive, and form.submit() all respect the rules without extra wiring.

License

MIT