{"id":25096,"library":"coffee2closure","title":"coffee2closure","description":"A utility that fixes CoffeeScript-compiled JavaScript output to be compatible with Google Closure Compiler. Version 0.1.12 is the latest stable release as of late 2013, with no active development since then. It addresses issues like missing 'var' declarations and proper function expression wrapping that break Closure Compiler's advanced optimizations. Unlike manual post-processing, it automates these fixes. The package is designed for build pipelines, notably used as a Grunt plugin. Given its age and lack of updates, it should be considered deprecated for modern projects.","status":"deprecated","version":"0.1.12","language":"javascript","source_language":"en","source_url":"https://github.com/steida/coffee2closure","tags":["javascript","Closure","CoffeeScript","Compiler","Google","gruntplugin"],"install":[{"cmd":"npm install coffee2closure","lang":"bash","label":"npm"},{"cmd":"yarn add coffee2closure","lang":"bash","label":"yarn"},{"cmd":"pnpm add coffee2closure","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package provides a single default export as a function. CommonJS require works in Node.","wrong":"const coffee2closure = require('coffee2closure')","symbol":"default","correct":"import coffee2closure from 'coffee2closure'"},{"note":"When used with Grunt, load via loadNpmTasks and configure in Gruntfile.","wrong":"require('coffee2closure')()","symbol":"grunt plugin","correct":"grunt.loadNpmTasks('coffee2closure')"},{"note":"coffee2closure is a function, not a constructor. Call it directly.","wrong":"new coffee2closure()","symbol":"function call","correct":"coffee2closure('input.coffee')"}],"quickstart":{"code":"import coffee2closure from 'coffee2closure'; import fs from 'fs'; const input = fs.readFileSync('input.coffee', 'utf8'); const output = coffee2closure(input); console.log(output);","lang":"javascript","description":"Shows how to import and use coffee2closure to transform CoffeeScript code for Closure Compiler compatibility."},"warnings":[{"fix":"Consider using modern alternatives like decaffeinate or direct transpilation with Babel.","message":"Package is no longer maintained and has not been updated since 2013.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Ensure you pass .coffee file contents, not .js.","message":"Input must be CoffeeScript source code, not compiled JavaScript.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Review the output and apply additional fixes if needed.","message":"The output may still require manual adjustments for strict Closure Compiler settings.","severity":"gotcha","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":"Run `npm install coffee2closure --save-dev` and ensure your import uses the correct path.","cause":"Package not installed or import path incorrect.","error":"Error: Cannot find module 'coffee2closure'"},{"fix":"Use `import coffee2closure from 'coffee2closure'` or `const coffee2closure = require('coffee2closure')`.","cause":"Using default import incorrectly or requiring the wrong export.","error":"TypeError: coffee2closure is not a function"},{"fix":"Fix the CoffeeScript syntax before passing it to coffee2closure.","cause":"Input contains invalid CoffeeScript.","error":"CoffeeScript syntax error on line X"},{"fix":"Add `grunt.loadNpmTasks('coffee2closure')` in your Gruntfile.","cause":"Grunt plugin not loaded correctly.","error":"Grunt task not found: coffee2closure"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}