{"library":"onelang","title":"OneLang","description":"OneLang is a source-to-source transpiler framework that enables writing code in multiple programming languages simultaneously. Currently at version 0.0.7, it is in early development with no stable release cadence. Unlike traditional transpilers, OneLang has its own type system and AST, and does not fully respect the syntax of input languages. It targets developers who want to generate code in multiple languages from a single source, but requires mastery of both target languages and OneLang itself. Key differentiators: self-defined rules, strong typing, and generic support, but limited maturity and documentation.","language":"javascript","status":"active","last_verified":"Fri May 01","install":{"commands":["npm install onelang"],"cli":{"name":"onelang","version":null}},"imports":["import { OneLang } from 'onelang'","import { Transpiler } from 'onelang'","import type { ASTNode } from 'onelang'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { OneLang } from 'onelang';\n\nconst oneLang = new OneLang();\noneLang.addSource('example.ts', `\nfunction greet(name: string): string {\n  return 'Hello, ' + name;\n}\n`);\n// Transpile to JavaScript\nconst result = oneLang.transpile('example.ts', 'javascript');\nconsole.log(result);\n// Expected output: 'function greet(name) { return \"Hello, \" + name; }'","lang":"typescript","description":"Creates a OneLang instance, adds a TypeScript source file, and transpiles it to JavaScript.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}