swc node binding use wasm

Related tags

Utilities node_swc
Overview

node_swc

swc node binding use wasm

Build

Make sure you have rust wasm-pack installed.

$ yarn build # build wasm, node

Usage

import { parseSync, printSync } from 'node-swc'

const ast = parseSync(`const a: string = "hello world"`, {
  syntax: 'typescript'
})

const { code } = printSync(ast, {
  minify: true
})

License

MIT

You might also like...
Node/Electron library for global key listening.

GlobalKey Building cargo install nj-cli nj-cli build --release Calling from node npm i globalkey # or yarn add globalkey const globalkey = require(

Another attempt at creating a wrapper for fastcdc in node.js

Another attempt at creating a wrapper for fastcdc in node.js. This time using wasmbindgen instead of neon.

A fresh FRAME-based Substrate node, ready for hacking

A substrate-based chain that runs in a single node, but simulates the existence of a large set of validators and nominators.

Pegasus: A Multi-Node Command Runner
Pegasus: A Multi-Node Command Runner

Run a list of commands on a set of SSH nodes. With a bit of optional parametrization.

Extremely fast JavaScript minifier, available for Rust and Node.js

minify-js Extremely fast JavaScript minifier, written in Rust. Goals Fully written in Rust for maximum compatibility with Rust programs and derivative

Node.js bindings for feed_rs

Description Node.js bindings for feed_rs. Installation npm install @nooptoday/feed-rs Usage import { parse } from '@nooptoday/feed-rs' const response

A reactive DOM library for Rust in WASM

maple A VDOM-less web library with fine-grained reactivity. Getting started The recommended build tool is Trunk. Start by adding maple-core to your Ca

A low-ish level tool for easily writing and hosting WASM based plugins.

A low-ish level tool for easily writing and hosting WASM based plugins. The goal of wasm_plugin is to make communicating across the host-plugin bounda

wasm actor system based on lunatic

Wactor WASM actor system based on lunatic. Actors run on isolated green threads. They cannot share memory, and communicate only through input and outp

Comments
  • ts转换失败, demo示例参数少target的默认值

    ts转换失败, demo示例参数少target的默认值

    能转换ts吗? 目前看着js的转换时可以的, 但是ts的转换transformSync会报错

    import { parseSync, printSync, transformSync } from "./node_swc.js";
    // ts的会报错
    // const str = `const a: string = "hello world"`
    
    const str = `const a = "hello world"`;
    const ast = parseSync(str, {
      syntax: "typescript",
    });
    console.log(ast);
    const res1 = printSync(ast, {
      minify: true,
    });
    console.log(res1);
    const res2 = transformSync(res1.code, {
      minify: true,
    });
    console.log(res2);
    
    
    opened by ahaoboy 2
Owner
伊撒尔
Chinese && Student && He/him Creator of Fre and other tiny libraries
伊撒尔
notify Node.js binding via napi-rs.

@napi-rs/notify notify Node.js binding via napi-rs. Install this package yarn add

LongYinan 9 Jun 6, 2022
[SWC plugin] workaround for jest

[SWC plugin] workaround for jest This is a SWC plugin to handle jest compatibility issues. This SWC plugin should be used with @swc/jest. usage instal

magic-akari 17 Dec 19, 2022
An experimental transpiler to bring tailwind macros to SWC 🚀

stailwc (speedy tailwind compiler) This is an experimental SWC transpiler to bring compile time tailwind macros to SWC (and nextjs) a-la twin macro. T

Alexander Lyon 139 Dec 20, 2022
SWC plugin for transform Vue3-jsx syntax

swc-plugin-transform-vue3-jsx ?? SWC plugin for faster conversion vue3-jsx. Installation npm npm install swc-plugin-transform-vue3-jsx -D yarn yarn ad

null 4 Oct 19, 2022
A swc plugin that automatically converts React component libraries into "React Client Component"

A swc plugin that automatically converts React component libraries into "React Client Component". For example, you can automatically convert components from @mui into "React Client Component" without having to wrap a component that uses "use client".

xiaotian 3 Jul 12, 2023
A Wasm component optimizer (mostly a wrapper around wasm-opt)

component-opt An optimizer for Wasm Components Current Status This project currently only offers one optimization and does not allow it to be configur

Robin Brown 6 Mar 4, 2024
Adapter plugin to use Ruff in dprint's CLI and with JavaScript via Wasm

dprint-plugin-ruff Adapter for Ruff for use as a formatting plugin in dprint. Formats .py and .pyi files. Note: For formatting .ipynb files, use the J

null 3 Nov 28, 2023
Rust binding of fortran Limited memory LBFGS subroutine

lbfgs-sys Rust binding of fortran L-BFGS-B subroutine. The orginal fortran subroutine is distributed under BSD-3 license. To know more about the condi

Naushad Karim 10 Sep 23, 2022
Calcit binding to Rust regex

Rust library for Calcit runtime.

Calcit 1 Nov 19, 2021
Rust binding for WFA2-lib

Rust bindings for WFA2-Lib Rust language bindgings for the excellent WFA2-Lib library. Work in progress. Tests and features are not yet complete. Usag

Haibao Tang 4 Jun 17, 2022