Martin-Eckleben / jsx-transpiler

A simple npm package to transpile random JSX code to Javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JSX Transpiler

A simple utility library to transform a JSX text to its equivalent React Javascript code.

It is designed to be used inside a node application.

Licensed under GPL v3 or later.

import { transpile } from '@hypersay/jsx-transpiler';

const source = `
  <div className="pinky">
    <p>Hello World!</p>
    <p>Today is {new Date()}</p>
  </div>
`;
transpile(source, { pragma: 'customFn', minified: true });
// 
// {
//     code: 'customFn("div",{className:"pinky"},customFn("p",null,"Hello World!"),customFn("p",null,"Today is ",new Date));'
//  }

Contact Cristian Dinu for details or use GitHub issues / PRs.

About

A simple npm package to transpile random JSX code to Javascript


Languages

Language:TypeScript 83.3%Language:JavaScript 16.7%