The SWC compiler for Deno.
import { parse, print } from "https://x.nest.land/swc@0.0.6/mod.ts";
const ast = parse(`const x: string = "Hello, Deno SWC!"`,{
syntax: "typescript"
});
// {
// type: "Module",
// span: { start: 0, end: 36, ctxt: 0 },
// body: [
// {
// type: "VariableDeclaration",
// span: [Object],
// kind: "const",
// declare: false,
// declarations: [Array]
// }
// ],
// interpreter: null
// }
let code = print(ast, {
minify: true,
isModule: true,
}).code;
// const x: string = "Hello, Deno SWC!";
deno_swc is licensed under the MIT license. Please see the LICENSE file.