Babel's modular runtime helpers that provide transpilation support for modern JavaScript features
94
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.
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<div>Hello</div> and React preset configuration, the transformation converts JSX to React.createElement calls @testsourceMaps: true, the result includes a map property with source mapping information @test@generates
/**
* 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);Provides JavaScript transformation capabilities including file reading and transformation.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-babel--runtimedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10