Registry / serialization / coffee-script-to-typescript

coffee-script-to-typescript

JSON →
library0.1.0jsnpmunverified

Transpile CoffeeScript code to TypeScript (v0.1.0, last updated 2013). Aims to produce idiomatic TypeScript rather than perfectly equivalent code, targeting migration of codebases to TypeScript. Key differentiator: focuses on translation to TypeScript syntax, not JavaScript. Release cadence: single initial release only. Note: outdated, may not work with modern Node.js or TypeScript.

npm install coffee-script-to-typescript
INSTALL
IMPORT
SIG · COFFEE-SCRIPT-TO-T
C
coffee-script-to-typescript
serializationjavascriptv0.1.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 coffeeToTypescript from 'coffee-script-to-typescript'
const coffeeToTypescript = require('coffee-script-to-typescript')
Package is ESM-only? Actually old package likely CJS. Use require if on Node < 13.

Transpile CoffeeScript to TypeScript using the library function and handle errors due to limited compatibility.

const { transpile } = require('coffee-script-to-typescript'); const coffeeCode = `square = (x) -> x * x`; try { const tsCode = transpile(coffeeCode, { comments: true }); console.log(tsCode); } catch (err) { console.error('Transpilation failed:', err.message); }
coffee-script-to-typescript --version
Debug
Known issues
breakingGenerated code may have type errors due to missing type annotations
fix
Manually add type annotations after transpilation.
affects: >=0.0.0
breakingRequires underscore runtime: uses _.range for CoffeeScript ranges
fix
Install underscore and ensure it's available in the runtime.
affects: >=0.0.0
breakingDoes not support modern CoffeeScript syntax (e.g., ES6 modules)
fix
Use alternatives like decaffeinate or ts-ify for modern codebases.
affects: >=0.0.0
deprecatedPackage is unmaintained since 2013
fix
Migrate to decaffeinate or TypeScript compiler with CoffeeScript plugin.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'underscore'
Missing peer dependency underscore required by generated code or library itself
fix
npm install underscore && require('underscore') before using the library.
RangeError: Invalid array length at _.range
CoffeeScript range [9...0] generates _.range(9,0) which returns empty array instead of descending
fix
Use custom range function or manually adjust generated code for descending ranges.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
underscorerequiredRuntime dependency for generated code (e.g., _.range)
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
coffee-script-to-typescript — npm install coffee-script-to-typescript · libregistry