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

@json-edit-react/utils

v0.9.0-beta.2

Published

Utility hooks and helpers for json-edit-react

Readme

@json-edit-react/utils

A collection of hooks and helpers for json-edit-react to make utilising more advanced features of json-edit-react easier, but without polluting the core with excess functionality. Undo/redo, confirmation dialogs, reactive validation, composable filter builders, and more — each one is optional, tree-shakeable, and brings no runtime dependencies of its own.

🚨 IMPORTANT

Requires json-edit-react version 2.x

Install

npm install @json-edit-react/utils
# or
yarn add @json-edit-react/utils
# or
pnpm add @json-edit-react/utils

json-edit-react and react are peer dependencies.

Undo / redo

Add undo/redo to the editor in a couple of lines. useUndo wraps your data/setData, tracks changes, and returns ready-to-wire undo / redo / canUndo / canRedo

Try it out in the Demo.

Read more →

Confirm before update

Gate edits, deletions, or any change behind a confirmation dialog —— this solves the common problem of await-ing a modal result, when a React modal is fundamentally declarative.

useConfirmOnUpdate hands you a ready-made onUpdate and the dialog state to drive your own modal — You provide the modal UI, we handle the data flow. useJsonEditorConfirm is the lower-level primitive for flows a single synchronous confirm can't express (confirming on awaited work, multiple confirmations in one update, or actions outside onUpdate).

▶ Live example: Modal confirmation

Read more →

Reactive validation

You can already validate your data against a JSON Schema or some other rule set, but if you want the validation state to be reflected in the UI (styled nodes, custom icons, etc), reach for this utility, particularly if you have cross-node validation (i.e. changes in one value affect the )

Run your own validator over the whole document and flag invalid nodes — in styles, a custom-node glyph, or allow* gates — with the right answer even for cross-branch validity effects that fine-grained re-rendering would otherwise leave stale. useValidationState returns an O(1), identity-stable error index; validationStyles turns it into theme sugar and ajvAdapter bridges a compiled AJV validator. It's built on useStableValue, an identity-stabilizer exported in its own right for any other cross-branch derived value. Zero runtime dependencies — you bring the validator.

Read more →

Filter-function toolkit

Compose the allow* props and searchFilter from small, named, readable pieces instead of hand-rolled callbacks — and(not(byKey('id')), byLevel({ min: 2 })). Property builders (byKey, byPath, byLevel, byType, …), position constants (root, collections, primitives, …), and / or / not combinators, and search bridges, every one inline-safe: each result is interned, so you write them straight on a prop with no useMemo.

▶ Live example: Filter toolkit

Read more →

Icon definitions from SVG

Drop a copied SVG straight into a theme's icons. iconFromSvg turns raw SVG markup (or a React <svg> element) into the IconDefinition core expects — stripping the outer tag and lifting viewBox and presentation attributes into the right fields — so the glyph picks up your theme's icon colour and sizing automatically. Zero runtime dependencies.

Read more →

Planned utilities

JSON Schema → Filter Functions

Generate allowEdit / allowDelete / allowAdd (and friends) directly from a JSON Schema, so the editor UI can't produce invalid data in the first place — the preventive complement to reactive validation. (#285)

Search helpers

Ready-made searchFilter functions for common search patterns, plus a helper to auto-expand the collapsed ancestors of search matches. (#319)

Have an idea, or built something useful yourself? Create an issue or a PR.

License

MIT