Registry / web-framework / ts-to-unitycs

ts-to-unitycs

JSON →
library1.0.0jsnpmunverified

A transpiler that converts a TypeScript-like DSL into Unity C# code. Version 1.0.0 – initial release with single-cycle translation, no ongoing maintenance indicated. Differentiates by enabling Unity developers to write game logic in a syntax familiar from TypeScript while generating standard C# scripts for the Unity engine. No release cadence documented; likely a one-off or early-stage tool.

npm install ts-to-unitycs
INSTALL
IMPORT
SIG · TS-TO-UNITYCS
T
ts-to-unitycs
web-frameworkjavascriptv1.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 (transpile function)
import transpile from 'ts-to-unitycs'
const { transpile } = require('ts-to-unitycs')
Only a default export is available at version 1.0.0; named import will fail.
transpile (as function)
import t from 'ts-to-unitycs'
import { t } from 'ts-to-unitycs'
Module exports a single default function; destructuring assignment is not supported.
TranspilerOptions
import type { TranspilerOptions } from 'ts-to-unitycs'
import { TranspilerOptions } from 'ts-to-unitycs'
Type imports require 'import type' or 'import { TranspilerOptions as _ }' to avoid runtime value import.

Transpile a TypeScript-like DSL snippet to Unity C# and write to a .cs file.

import transpile from 'ts-to-unitycs'; import { writeFileSync } from 'fs'; const dslCode = ` class PlayerController { private speed: number = 10; public Move(direction: Vector3): void { // translate } }`; try { const csharpCode: string = transpile(dslCode); writeFileSync('PlayerController.cs', csharpCode, 'utf8'); console.log('Generated PlayerController.cs'); } catch (err) { console.error('Transpilation failed:', err); }
ts-to-unitycs --version
Debug
Known issues
breakingThe generated C# code may have incomplete syntactic coverage; use with caution.
fix
Manually review and adjust output for production use.
affects: 1.0.0
gotchaOnly a subset of TypeScript features are supported (e.g. no async/await, generics limited).
fix
Refer to the documentation for supported features.
affects: 1.0.0
gotchaNo official tests or CI pipeline; reliability not guaranteed.
fix
Contribute tests or use alternative tools.
affects: 1.0.0
Errors
Common errors & fixes
Cannot find module 'ts-to-unitycs'
Package not installed or incorrectly referenced.
fix
Run `npm install ts-to-unitycs` or add to package.json.
transpile is not a function
Incorrect import of the default export as a named import.
fix
Use `import transpile from 'ts-to-unitycs'` instead of `import { transpile } from 'ts-to-unitycs'`.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
typescriptrequiredRequired for TypeScript parsing and AST generation.
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
2
Resources
ts-to-unitycs — npm install ts-to-unitycs · libregistry