{"id":26670,"library":"yajc","title":"yajc","description":"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.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install yajc","lang":"bash","label":"npm"},{"cmd":"yarn add yajc","lang":"bash","label":"yarn"},{"cmd":"pnpm add yajc","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; no CommonJS export.","wrong":"const yajc = require('yajc')","symbol":"default","correct":"import yajc from 'yajc'"},{"note":"Named export; not default.","wrong":"import convert from 'yajc'","symbol":"convert","correct":"import { convert } from 'yajc'"},{"note":"Type imports available for TypeScript users.","wrong":"","symbol":"yajc (types)","correct":"import type { Options } from 'yajc'"}],"quickstart":{"code":"import { convert } from 'yajc';\n\nconst json = '{\"name\": \"Alice\", \"age\": 30}';\nconst result = convert(json, { language: 'go', package: 'main' });\nconsole.log(result);\n// Output:\n// type AutoGenerated struct {\n//   Name string `json:\"name\"`\n//   Age  int    `json:\"age\"`\n// }","lang":"typescript","description":"Converts a JSON string to a Go struct using the programmatic API with custom options."},"warnings":[{"fix":"Pre-validate JSON using JSON.parse() before passing to yajc.","message":"yajc does not validate JSON input; invalid JSON may produce broken output without error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Wrap output in necessary boilerplate (e.g., package, imports).","message":"The generated code may not include imports or package declarations for all languages; you must add them manually.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Run 'npm install -g yajc' for CLI, or use programmatic API from local install.","message":"CLI global install required for command-line usage; local install only provides programmatic API.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use import instead of require, or run in an ESM context.","cause":"Attempting to require() the package in CommonJS; yajc is ESM-only.","error":"Cannot find module 'yajc'"},{"fix":"Run 'npm install -g yajc' to install globally.","cause":"yajc not installed globally; CLI bin not in PATH.","error":"yajc: command not found"},{"fix":"Use 'import { convert } from 'yajc'' instead of 'import yajc from 'yajc''.","cause":"Importing default instead of named export 'convert'.","error":"TypeError: convert is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}