Registry / devops / coffee2closure

coffee2closure

JSON →
library0.1.12jsnpmunverified

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.

npm install coffee2closure
INSTALL
IMPORT
SIG · COFFEE2CLOSURE
C
coffee2closure
devopsjavascriptv0.1.12
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 coffee2closure from 'coffee2closure'
const coffee2closure = require('coffee2closure')
The package provides a single default export as a function. CommonJS require works in Node.
grunt plugin
grunt.loadNpmTasks('coffee2closure')
require('coffee2closure')()
When used with Grunt, load via loadNpmTasks and configure in Gruntfile.
function call
coffee2closure('input.coffee')
new coffee2closure()
coffee2closure is a function, not a constructor. Call it directly.

Shows how to import and use coffee2closure to transform CoffeeScript code for Closure Compiler compatibility.

import coffee2closure from 'coffee2closure'; import fs from 'fs'; const input = fs.readFileSync('input.coffee', 'utf8'); const output = coffee2closure(input); console.log(output);
Debug
Known issues
deprecatedPackage is no longer maintained and has not been updated since 2013.
fix
Consider using modern alternatives like decaffeinate or direct transpilation with Babel.
affects: >=0.0.0
gotchaInput must be CoffeeScript source code, not compiled JavaScript.
fix
Ensure you pass .coffee file contents, not .js.
affects: >=0.0.0
gotchaThe output may still require manual adjustments for strict Closure Compiler settings.
fix
Review the output and apply additional fixes if needed.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'coffee2closure'
Package not installed or import path incorrect.
fix
Run `npm install coffee2closure --save-dev` and ensure your import uses the correct path.
TypeError: coffee2closure is not a function
Using default import incorrectly or requiring the wrong export.
fix
Use `import coffee2closure from 'coffee2closure'` or `const coffee2closure = require('coffee2closure')`.
CoffeeScript syntax error on line X
Input contains invalid CoffeeScript.
fix
Fix the CoffeeScript syntax before passing it to coffee2closure.
Grunt task not found: coffee2closure
Grunt plugin not loaded correctly.
fix
Add `grunt.loadNpmTasks('coffee2closure')` in your Gruntfile.
Upgrade
Version history
0.1.12latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
coffee2closure — npm install coffee2closure · libregistry