Registry / serialization / yajc
library1.0.0jsnpmunverified

yajc (Yet Another Json Transpiler) v1.0.0 generates Java POJOs, Go structs, and other data models from JSON input. It provides a simple CLI and programmatic API for converting JSON schemas into strongly-typed language constructs. Released as a stable single version with no ongoing updates. Differentiators: lightweight, no runtime dependencies beyond Node.js, and supports multiple output languages from a single tool.

npm install yajc
INSTALL
IMPORT
SIG · YAJC
Y
yajc
serializationjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import yajc from 'yajc'
const yajc = require('yajc')
ESM-only; no CommonJS export.
convert
import { convert } from 'yajc'
import convert from 'yajc'
Named export; not default.
yajc (types)
import type { Options } from 'yajc'
Type imports available for TypeScript users.

Converts a JSON string to a Go struct using the programmatic API with custom options.

import { convert } from 'yajc'; const json = '{"name": "Alice", "age": 30}'; const result = convert(json, { language: 'go', package: 'main' }); console.log(result); // Output: // type AutoGenerated struct { // Name string `json:"name"` // Age int `json:"age"` // }
yajc --version
Debug
Known issues
gotchayajc does not validate JSON input; invalid JSON may produce broken output without error.
fix
Pre-validate JSON using JSON.parse() before passing to yajc.
affects: >=1.0.0
gotchaThe generated code may not include imports or package declarations for all languages; you must add them manually.
fix
Wrap output in necessary boilerplate (e.g., package, imports).
affects: >=1.0.0
gotchaCLI global install required for command-line usage; local install only provides programmatic API.
fix
Run 'npm install -g yajc' for CLI, or use programmatic API from local install.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'yajc'
Attempting to require() the package in CommonJS; yajc is ESM-only.
fix
Use import instead of require, or run in an ESM context.
yajc: command not found
yajc not installed globally; CLI bin not in PATH.
fix
Run 'npm install -g yajc' to install globally.
TypeError: convert is not a function
Importing default instead of named export 'convert'.
fix
Use 'import { convert } from 'yajc'' instead of 'import yajc from 'yajc''.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
yajc — npm install yajc · libregistry