or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@babel/runtime@7.28.x
tile.json

tessl/npm-babel--runtime

tessl install tessl/npm-babel--runtime@7.28.0

Babel's modular runtime helpers that provide transpilation support for modern JavaScript features

Agent Success

Agent success rate when using this tile

94%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.19x

Baseline

Agent success rate without this tile

79%

task.mdevals/scenario-3/

JavaScript File Transformer

Build a tool that transforms JavaScript files from disk using a transformation library. The tool should support both synchronous and asynchronous file transformation with configurable plugins.

Capabilities

Basic File Transformation

  • Given a file path "test-input.js" containing const add = (a, b) => a + b; and arrow function transformation enabled, the synchronous transform returns code with the arrow function converted to a regular function @test
  • Given the same input file and asynchronous transformation, the async transform returns a Promise that resolves to code with the arrow function converted @test

Plugin Configuration

  • Given a file containing JSX syntax <div>Hello</div> and React preset configuration, the transformation converts JSX to React.createElement calls @test
  • Given a file with multiple modern features and multiple plugins configured, all specified transformations are applied correctly @test

Source Maps

  • When requesting source maps in the transformation options with sourceMaps: true, the result includes a map property with source mapping information @test

Error Handling

  • When the input file contains syntax errors, the transformation throws an error with line and column information @test

Implementation

@generates

API

/**
 * Transforms a JavaScript file synchronously
 *
 * @param {string} filePath - Path to the JavaScript file to transform
 * @param {Object} options - Transformation options including presets, plugins, and sourceMaps
 * @returns {Object} Transformation result with code and optional map properties
 */
function transformFileSync(filePath, options);

/**
 * Transforms a JavaScript file asynchronously
 *
 * @param {string} filePath - Path to the JavaScript file to transform
 * @param {Object} options - Transformation options including presets, plugins, and sourceMaps
 * @returns {Promise<Object>} Promise resolving to transformation result with code and optional map properties
 */
async function transformFileAsync(filePath, options);

Dependencies { .dependencies }

@babel/core { .dependency }

Provides JavaScript transformation capabilities including file reading and transformation.

@satisfied-by