Registry / data / coffee-compiler

coffee-compiler

JSON →
library0.3.2jsnpmunverified

A lightweight wrapper for the CoffeeScript compiler providing a unified API (fromSource/fromFile) across compiler libraries. Current version 0.3.2. The package has not been updated since 2014 and relies on an outdated peer dependency coffee-script >=1.6.2. It offers simple callback-based compilation with source maps and bare mode options.

npm install coffee-compiler
INSTALL
IMPORT
SIG · COFFEE-COMPILER
C
coffee-compiler
datajavascriptv0.3.2
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
var coffee = require('coffee-compiler');
import coffee from 'coffee-compiler';
CJS-only; no ESM support. Use require()
fromSource
var coffee = require('coffee-compiler'); coffee.fromSource('...', opts, cb);
const { fromSource } = require('coffee-compiler');
fromSource is a method on the default export, not a named export
fromFile
var coffee = require('coffee-compiler'); coffee.fromFile('./file.coffee', opts, cb);
import { fromFile } from 'coffee-compiler';
fromFile is a method on the default export, not a named export

Compile CoffeeScript source string to JavaScript with source map and bare mode.

var coffee = require('coffee-compiler'); coffee.fromSource('console.log "hello world!"', { sourceMap: true, bare: true }, function(err, js) { if (err) throw err; console.log(js); });
Debug
Known issues
gotchaPackage has been abandoned since 2014; no updates for CoffeeScript 2.x or modern Node.js versions.
fix
Use coffee-script directly or switch to an actively maintained compiler like decaffeinate or coffeescript@next.
affects: >=0.0.0
gotchaPeer dependency coffee-script must be installed separately; npm@3+ does not auto-install peers.
fix
Run 'npm install coffee-script' alongside coffee-compiler.
affects: >=0.0.0
deprecatedCallback-based API; no promise/async support. Promises are not available.
fix
Promisify manually or use coffee-script's own compile method.
affects: >=0.0.0
gotchaOptions object may be mutated; not documented but internal behavior could cause side effects.
fix
Clone options before passing: coffee.fromSource(src, Object.assign({}, opts), cb);
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'coffee-script'
Missing peer dependency coffee-script.
fix
Run 'npm install coffee-script' in your project.
TypeError: coffee.fromSource is not a function
Using incorrect import pattern (e.g., destructuring or ES import).
fix
Use 'var coffee = require('coffee-compiler');' then call coffee.fromSource().
Error: require() of ES Module not supported
Attempting to require coffee-compiler from an ES module environment.
fix
Use dynamic import() or switch to an ESM-compatible compiler.
Upgrade
Version history
0.3.2latest on npm
Audit
Dependencies
coffee-scriptrequiredpeer dependency required at runtime for compilation
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
coffee-compiler — npm install coffee-compiler · libregistry