# parse5-babel-jsx-adapter

> This is a tiny AST Tree Adapter that transform Parse5 AST to Babel JSX AST

Latest version **0.1.0** (published 2020-10-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install parse5-babel-jsx-adapter
pnpm add parse5-babel-jsx-adapter
yarn add parse5-babel-jsx-adapter
bun add parse5-babel-jsx-adapter
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-10-26 |
| First published | 2020-10-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 65.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | hlhr202@163.com |
| Maintainers | hlhr202 |

## Links

- npm: https://www.npmjs.com/package/parse5-babel-jsx-adapter
- Repository: https://github.com/hlhr202/Parse5-Babel-JSX-Adapter
- Issues: https://github.com/hlhr202/Parse5-Babel-JSX-Adapter/issues
- npm.io page: https://npm.io/package/parse5-babel-jsx-adapter

## Recent versions

- 0.1.0 (latest) — 2020-10-26

## README

# Parse5 Babel JSX Adapter (WIP)

This is a tiny AST Tree Adapter that transform Parse5 AST to Babel JSX AST

This project is still under development, please do not use in production

---

## Usage

- Install

  ```bash
  npm install --save parse5 @babel/core parse5-babel-jsx-adapter
  ```

- Import in your code (typescript)
  
  ```typescript
  import generator from '@babel/generator';
  import { parse } from 'parse5';
  import { Adapter, BabelJSXWrapperDocument } from 'parse5-babel-jsx-adapter';

  const text = '<div class="cls">txt<button>btn</button></div>';
  const document = parse(text, { treeAdapter: new Adapter() }) as BabelJSXWrapperDocument;

  console.log(JSON.stringify(document.ast, null, 2));
  // print babel jsx entry ast
  console.log(generator(document.ast).code)
  // print code same as you text input
  ```

---
_Source: https://npm.io/package/parse5-babel-jsx-adapter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
