
Research
/Security News
Fake imToken Chrome Extension Steals Seed Phrases via Phishing Redirects
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.
json-schema-codec-generator
Advanced tools
Generate typed codec validator code from collections of json-schema
Generate typed codec validator code from collections of inter-related json-schema
Generate typed codecs from collections of json-schema using the included library or the bundled CLI.
$references between one-another.To install the CLI, the recommended approach is to install it globally.
npm install -g json-schema-codec-generator
Alternatively, you can use npx to install and run it on-demand.
npx json-schema-codec-generator --help
Given a folder full of .json files containing JSON-Schema definitions in ./path/to/my/schema/dir, the following will produce:
./codecs/index.js -- JavaScript code that exports a ValidatorFunction<T> function for each discovered schema. These functions have no runtime dependencies and thus can be used in any JavaScript runtime.
Each Schema passed in will have a corresponding ValidatorFunction generated.
./codecs/index.d.ts -- TypeScript definition files for the generated codecs. These type definitions ensure that code consuming the codecs will benefit from compile-time and edit-time type hinting.
json-schema-codec-generator --input ./path/to/my/schema/dir --output ./codecs/
export interface ErrorObject {
instancePath: string;
message?: string;
data?: unknown;
}
export interface ValidatorFunction<T> {
(obj: unknown): obj is T;
errors?: ErrorObject[];
}
For a given schema named Bookmark, a validator function named validateBookmark of type ValidatorFunction<Bookmark> will be exported as well as a Bookmark type. These functions can be used as type assertions. Immediately after calling a validator function and seeing a validation failure, the validation errors can be recovered from validateBookmark.errors.
FAQs
Generate typed codec validator code from collections of json-schema
The npm package json-schema-codec-generator receives a total of 118 weekly downloads. As such, json-schema-codec-generator popularity was classified as not popular.
We found that json-schema-codec-generator demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Research
/Security News
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.

Security News
Latio’s 2026 report recognizes Socket as a Supply Chain Innovator and highlights our work in 0-day malware detection, SCA, and auto-patching.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.