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-7/

Module Loader Utility

A utility that compiles and loads CoffeeScript modules with ES6 import/export syntax support.

Capabilities

Compile modules with ES6 imports

Compile CoffeeScript code containing ES6 import statements into JavaScript that preserves the import syntax.

  • Given CoffeeScript code import { add } from './math', the compiled output contains a valid ES6 import statement @test
  • Given CoffeeScript code with default import import Calculator from './calc', the compiled output contains the correct default import @test

Compile modules with ES6 exports

Compile CoffeeScript code containing ES6 export statements into JavaScript that preserves the export syntax.

  • Given CoffeeScript code export add = (a, b) -> a + b, the compiled output contains a valid named export @test
  • Given CoffeeScript code with default export export default class Calculator, the compiled output contains the correct default export @test

Automatic bare mode activation

When compiling modules with import or export statements, the compiler automatically activates bare mode (no function wrapper).

  • Given CoffeeScript code with an export statement, the compiled output does not have a top-level function wrapper @test

Implementation

@generates

API

# Compiles CoffeeScript code and returns JavaScript output
# @param {String} code - The CoffeeScript source code to compile
# @return {String} The compiled JavaScript code
export compileModule = (code) ->

# Checks if compiled code is in bare mode (no wrapper function)
# @param {String} code - The CoffeeScript source code
# @return {Boolean} True if the compiled output is in bare mode
export isBareMode = (code) ->

Dependencies { .dependencies }

coffeescript { .dependency }

Provides CoffeeScript compilation with ES6 module support.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-coffeescript

tile.json