
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@json-eval-rs/bundler
Advanced tools
JSON Eval RS for bundlers (Webpack, Vite, Next.js, etc.) with ergonomic API
JSON Eval RS for modern bundlers (Webpack, Vite, Rollup, Next.js, etc.) with ergonomic API.
yarn install @json-eval-rs/bundler
# or
yarn add @json-eval-rs/bundler
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: 'john@example.com' }
});
// Get schema values
const values = await evaluator.getSchemaValue();
// Clean up when done
evaluator.free();
new JSONEval(options)Create a new evaluator instance.
Options:
schema (required) - JSON schema objectcontext (optional) - Context data objectdata (optional) - Initial data objectawait 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.
'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
}
MIT
FAQs
JSON Eval RS for bundlers (Webpack, Vite, Next.js, etc.) with ergonomic API
We found that @json-eval-rs/bundler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.