UNPKG

xnr

Version:

Easily, quickly and reliably run a Node.js script from the CLI.

20 lines (19 loc) 789 B
import { SucraseOptions } from "./utils"; /** * Transforms an input code string into a Node-friendly ECMAScript Module (ESM) code string. * * @param {Object} options - The options for transforming the code. * @param {string} options.code - The input code as a string. * @param {string} [options.filePath] - The path of the file being transformed. * @returns {Promise<string>} A promise that resolves with the transformed code. */ export declare const transform: ({ code, filePath, sucraseOptions, }: { code: string; filePath?: string; sucraseOptions?: SucraseOptions; }) => Promise<string>; export declare const transformSync: ({ code: inputCode, filePath, sucraseOptions, }: { code: string; filePath?: string; sucraseOptions?: SucraseOptions; }) => string;