npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@react-converter/core

v1.0.0

Published

Core conversion engine for React-Converter

Downloads

68

Readme

@react-converter/core

The core conversion engine for react-converter. This library provides the logic for parsing JSX, transforming ASTs, and generating framework-free vanilla JavaScript components.

Features

  • JSX Parsing: Uses Babel to parse JSX and TypeScript.
  • AST Transformations: Converts React-style JSX into DOM-manipulation logic.
  • TailwindCSS Integration: Automatically extracts Tailwind classes and builds a minimal CSS bundle.
  • Web Component Support: Can wrap components into native Web Components with Shadow DOM.
  • Hooks Runtime: Provides a lightweight runtime for useState, useEffect, and useRef.

Installation

npm install @react-converter/core

API Usage

convert(code, options)

The main function to transform React code into vanilla JS.

import { convert } from '@react-converter/core';

const code = `
  function Greeting({ name }) {
    return <h1 className="text-blue-500">Hello {name}</h1>;
  }
`;

const result = await convert(code, {
  fileName: 'Greeting.jsx',
  tailwindConfig: './tailwind.config.js',
  webComponent: true,
  webComponentTag: 'my-greeting'
});

console.log(result.code);
// Output: Vanilla JS code implementing the component

Options

| Option | Type | Default | Description | | --- | --- | --- | --- | | fileName | string | 'component.jsx' | Used for identifying the component and naming. | | tailwindConfig | string | null | Path to your tailwind.config.js file. | | webComponent | boolean | false | Whether to emit a Web Component. | | webComponentTag | string | null | Custom tag name for the Web Component. | | usePlaceholders | boolean | false | Use $prefix for props as placeholders. |

Advanced Exports

The core also exports individual modules for more granular control:

  • parseFile(code): Parses code into a Babel AST.
  • transform(ast, options): Transforms the AST into an intermediate representation.
  • generateCode(components, fileName, options): Generates final JS code.
  • buildTailwindCSS({ configPath, content }): Compiles Tailwind CSS.
  • findTailwindConfig(inputDir): Helper to locate tailwind.config.js.

Architecture

The core is divided into several modules:

  1. Parser: Babel-based parser for modern JS/TS/JSX.
  2. Transformer: Traverses the AST to extract component logic and prepare it for generation.
  3. Generator: Takes the transformed data and produces the final string output.
  4. Tailwind: Handles class extraction and CSS compilation using PostCSS.
  5. Runtime: Minimalistic JS snippets for DOM manipulation and hooks support, which are embedded into the output.

License

Proprietary. See main repository for details.