/deno_swc

The SWC compiler for Deno.

Primary LanguageTypeScriptMIT LicenseMIT


deno_swc logo

deno_swc

The SWC compiler for Deno.

e2e-test dev-ci

Usage

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!";

Copyright

deno_swc is licensed under the MIT license. Please see the LICENSE file.