{"id":25094,"library":"coffee-script-to-typescript","title":"coffee-script-to-typescript","description":"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.","status":"deprecated","version":"0.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/palantir/coffee-script-to-typescript","tags":["javascript","language","typescript","coffeescript","compiler"],"install":[{"cmd":"npm install coffee-script-to-typescript","lang":"bash","label":"npm"},{"cmd":"yarn add coffee-script-to-typescript","lang":"bash","label":"yarn"},{"cmd":"pnpm add coffee-script-to-typescript","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime dependency for generated code (e.g., _.range)","package":"underscore","optional":false}],"imports":[{"note":"Package is ESM-only? Actually old package likely CJS. Use require if on Node < 13.","wrong":"const coffeeToTypescript = require('coffee-script-to-typescript')","symbol":"default","correct":"import coffeeToTypescript from 'coffee-script-to-typescript'"}],"quickstart":{"code":"const { transpile } = require('coffee-script-to-typescript');\nconst coffeeCode = `square = (x) -> x * x`;\ntry {\n  const tsCode = transpile(coffeeCode, { comments: true });\n  console.log(tsCode);\n} catch (err) {\n  console.error('Transpilation failed:', err.message);\n}","lang":"javascript","description":"Transpile CoffeeScript to TypeScript using the library function and handle errors due to limited compatibility."},"warnings":[{"fix":"Manually add type annotations after transpilation.","message":"Generated code may have type errors due to missing type annotations","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Install underscore and ensure it's available in the runtime.","message":"Requires underscore runtime: uses _.range for CoffeeScript ranges","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Use alternatives like decaffeinate or ts-ify for modern codebases.","message":"Does not support modern CoffeeScript syntax (e.g., ES6 modules)","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Migrate to decaffeinate or TypeScript compiler with CoffeeScript plugin.","message":"Package is unmaintained since 2013","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install underscore && require('underscore') before using the library.","cause":"Missing peer dependency underscore required by generated code or library itself","error":"Error: Cannot find module 'underscore'"},{"fix":"Use custom range function or manually adjust generated code for descending ranges.","cause":"CoffeeScript range [9...0] generates _.range(9,0) which returns empty array instead of descending","error":"RangeError: Invalid array length at _.range"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}