CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-coffeescript

A programming language that compiles into JavaScript, offering more concise and readable syntax while maintaining full JavaScript compatibility.

77

1.01x
Overview
Eval results
Files

task.mdevals/scenario-5/

CoffeeScript File Compiler

A utility that compiles CoffeeScript files from the filesystem with proper error handling and format detection.

Capabilities

File Compilation

  • Compiles a regular CoffeeScript file (.coffee) from the filesystem and returns JavaScript code @test
  • Compiles a literate CoffeeScript file (.litcoffee) from the filesystem and returns JavaScript code @test
  • Returns JavaScript code when compiling a file with BOM (Byte Order Mark) at the beginning @test

Error Handling

  • Throws an error with filename information when attempting to compile a file with syntax errors @test
  • Throws an error when attempting to compile a non-existent file @test

Implementation

@generates

API

/**
 * Compiles a CoffeeScript file from the filesystem.
 *
 * @param {string} filepath - The path to the CoffeeScript file to compile.
 * @param {Object} [options] - Compilation options (e.g., bare mode, source maps).
 * @returns {string} The compiled JavaScript code.
 * @throws {Error} Throws an error if the file cannot be read or contains syntax errors.
 */
function compileFile(filepath, options) {
  // IMPLEMENTATION HERE
}

module.exports = {
  compileFile
};

Dependencies { .dependencies }

coffeescript { .dependency }

Provides CoffeeScript compilation support.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-coffeescript

tile.json