Skip to content

tamusjroyce/deno_swc

 
 

Repository files navigation


deno_swc logo

deno_swc

The SWC compiler for Deno.

e2e-test dev-ci

import { parse, print } from "https://x.nest.land/swc@0.0.6/mod.ts";

const code = `const x: string = "Hello, Deno SWC!"`;
const ast = parse(code, {
  target: "es2019",
  syntax: "typescript",
  comments: false,
});
const regeneratedCode = print(ast, {
  minify: true,
  module: {
    type: "commonjs",
  },
}).code;

// {
//   type: "Module",
//   span: { start: 0, end: 36, ctxt: 0 },
//   body: [
//     {
//       type: "VariableDeclaration",
//       span: [Object],
//       kind: "const",
//       declare: false,
//       declarations: [Array]
//     }
//   ],
//   interpreter: null
// }

// console.log(code);
// console.log(ast);
console.log(regeneratedCode);

// interface H{h:string;}const x:string=`Hello, ${"Hello"} Deno SWC!`;switch(x){case "value":console.log(x);break;default:break}

Copyright

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

About

The SWC compiler for Deno.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 85.6%
  • Rust 6.9%
  • JavaScript 3.7%
  • Batchfile 2.5%
  • Shell 1.3%