{"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,"search_vec":"'anoth':4 'api':27 'beyond':53 'cli':24 'construct':37 'convert':29 'data':15 'depend':52 'differenti':48 'generat':8 'go':11 'input':19 'java':9 'javascript':64 'json':5,18,30 'languag':36,59 'lightweight':49 'model':16 'multipl':57 'node.js':54 'ongo':46 'output':58 'pojo':10 'programmat':26 'provid':21 'releas':38 'runtim':51 'schema':31 'simpl':23 'singl':42,62 'stabl':41 'strong':34 'strongly-typ':33 'struct':12 'support':56 'tool':63 'transpil':6 'type':35 'updat':47 'v1.0.0':7 'version':43 'yajc':1,2 'yet':3","created_at":"2026-05-01T13:51:11.306243+00:00","updated_at":"2026-05-01T13:51:11.306243+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"yajc","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/yajc","openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}