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-eval-rs/bundler

v0.0.60

Published

JSON Eval RS for bundlers (Webpack, Vite, Next.js, etc.) with ergonomic API

Readme

@json-eval-rs/bundler

JSON Eval RS for modern bundlers (Webpack, Vite, Rollup, Next.js, etc.) with ergonomic API.

Installation

yarn install @json-eval-rs/bundler
# or
yarn add @json-eval-rs/bundler

Usage

import { JSONEval } from '@json-eval-rs/bundler';

const evaluator = new JSONEval({
  schema: {
    type: 'object',
    properties: {
      name: {
        type: 'string',
        rules: {
          required: { value: true, message: 'Name is required' },
          minLength: { value: 3, message: 'Min 3 characters' }
        }
      },
      email: {
        type: 'string',
        rules: {
          required: { value: true, message: 'Email is required' },
          email: { value: true, message: 'Invalid email' }
        }
      }
    }
  }
});

// Initialize (loads WASM)
await evaluator.init();

// Validate data
const result = await evaluator.validate({
  data: { name: 'Jo', email: 'invalid' }
});

if (result.has_error) {
  console.log('Validation errors:', result.errors);
  // [{ path: 'name', rule_type: 'minLength', message: 'Min 3 characters' }, ...]
}

// Evaluate schema with data
const evaluated = await evaluator.evaluate({
  data: { name: 'John', email: '[email protected]' }
});

// Get schema values
const values = await evaluator.getSchemaValue();

// Clean up when done
evaluator.free();

API

new JSONEval(options)

Create a new evaluator instance.

Options:

  • schema (required) - JSON schema object
  • context (optional) - Context data object
  • data (optional) - Initial data object

await evaluator.init()

Initialize the WASM module. Must be called before other methods.

await evaluator.validate({ data, context? })

Validate data against schema rules.

Returns: { has_error: boolean, errors: ValidationError[] }

await evaluator.evaluate({ data, context? })

Evaluate schema with data and return evaluated schema.

await evaluator.evaluateDependents({ changedPaths, data, context?, nested? })

Re-evaluate fields that depend on changed paths.

await evaluator.getEvaluatedSchema({ skipLayout? })

Get the evaluated schema with optional layout resolution.

await evaluator.getSchemaValue()

Get all schema values (evaluations ending with .value).

await evaluator.reloadSchema({ schema, context?, data? })

Reload schema with new data.

await evaluator.cacheStats()

Get cache statistics: { hits, misses, entries }.

await evaluator.clearCache()

Clear the evaluation cache.

await evaluator.cacheLen()

Get number of cached entries.

evaluator.free()

Free WASM resources. Always call when done.

version()

Get library version string.

Example: Next.js

'use client';

import { JSONEval } from '@json-eval-rs/bundler';
import { useEffect, useState } from 'react';

export default function MyForm() {
  const [evaluator, setEvaluator] = useState(null);

  useEffect(() => {
    // Dynamically import (client-side only)
    import('@json-eval-rs/bundler').then(({ JSONEval }) => {
      const instance = new JSONEval({ schema });
      setEvaluator(instance);
    });

    return () => {
      if (evaluator) evaluator.free();
    };
  }, []);

  // ... use evaluator
}

License

MIT