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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@json-eval-rs/webcore

v0.0.41

Published

JSON Eval RS core JavaScript wrapper (internal package - not published)

Downloads

1,107

Readme

@json-eval-rs/webcore

High-level JavaScript API for JSON Eval RS WASM bindings.

Installation

# Install bridge + your target WASM package
yarn install @json-eval-rs/webcore @json-eval-rs/bundler

# Or for direct browser use
yarn install @json-eval-rs/webcore @json-eval-rs/vanilla

# Or for Node.js
yarn install @json-eval-rs/webcore @json-eval-rs/node

Usage

With Bundler (Webpack, Vite, Next.js, etc.)

import { JSONEval } from '@json-eval-rs/webcore';
import * as wasmModule 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' }
        }
      }
    }
  },
  wasmModule // Pass the WASM module explicitly
});

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

if (result.has_error) {
  console.log('Errors:', result.errors);
}

// Don't forget to free resources
evaluator.free();

Dynamic Import (for Next.js client components)

'use client';

useEffect(() => {
  Promise.all([
    import('@json-eval-rs/webcore'),
    import('@json-eval-rs/bundler')
  ]).then(([{ JSONEval }, wasmModule]) => {
    const evaluator = new JSONEval({ schema, wasmModule });
    // Use evaluator...
  });
}, []);

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
  • wasmModule (optional) - Pre-loaded WASM module

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.

Returns: Evaluated schema object

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

Re-evaluate fields that depend on changed paths.

Options:

  • changedPaths - Array of field paths that changed
  • data - Current data
  • context (optional) - Context data
  • nested (optional, default: true) - Follow dependency chains

Returns: Updated evaluated schema

evaluator.free()

Free WASM resources. Call this when done.

Why Use the Core?

The core package provides:

  1. Clean API - Options objects instead of positional JSON strings
  2. Type Safety - Full TypeScript support
  3. Auto-detection - Automatically loads the right WASM target
  4. Flexibility - Works with bundler/web/node targets

Direct WASM Usage

If you prefer minimal overhead, you can use WASM packages directly:

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

const instance = new JSONEvalWasm(
  JSON.stringify(schema),
  JSON.stringify(context),
  JSON.stringify(data)
);

const result = await instance.validate(JSON.stringify(data));
instance.free();

License

MIT