Skip to content

Latest commit

 

History

History
28 lines (24 loc) · 415 Bytes

README.md

File metadata and controls

28 lines (24 loc) · 415 Bytes

Babel JSX to AST Fragmented

@babel/parser wrapper for simple JSX tree.

npm i babel-jsx-to-ast-fragmented

export const Foo = (props) => {
  return (
    <div className="foo bar baz">
      <h1>Hello!</h1>
    </div>
  );
};
[
  [
    {
      name: 'div',
      position: { start: [Position], end: [Position] },
      attributes: [ [Object] ],
      children: [ [Object] ]
    }
  ]
]