@es-js/core
Version:
EsJS es un lenguaje de programación con sintaxis en Español que compila a JavaScript. Esto permite a las personas hispanohablantes escribir código de manera más familiar y accesible, sin renunciar al poder y versatilidad de JavaScript.
27 lines (24 loc) • 723 B
JavaScript
import putout from '@putout/bundle';
import { EsbabelCompiler } from './compiler/esbabel.compiler.mjs';
import { EssucraseCompiler } from './compiler/essucrase.compiler.mjs';
import './shared/core.985c229a.mjs';
import './plugins/index.mjs';
import './utils.mjs';
function compile(code, options = {
from: "esjs",
to: "js",
compiler: "essucrase"
}) {
if (!options.from) {
options.from = "esjs";
}
if (!options.to) {
options.to = "js";
}
if (!options.compiler) {
options.compiler = "essucrase";
}
const compiler = options?.compiler === "essucrase" ? new EssucraseCompiler(putout) : new EsbabelCompiler();
return compiler.compile(code, options);
}
export { compile, compile as transpile };