Transpile JSX to JS with non-standard syntax: ignores tag name capitalization (uses variable tracking), provides ES6-style parameter shorthand (defaults to variable with same name instead of true). Unmaintained since 2015; version 1.0.1 is the latest. Different from standard JSX transpilers (e.g., Babel) in semantics; useful for custom JSX runtimes that want shorthand syntax. No TypeScript definitions, no updates, likely abandonware.
npm install jsx-to-jsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to transform a JSX AST (parsed externally) into a JavaScript AST using jsx-to-js.
Ensure all components are in scope as variables; do not rely on capitalization to distinguish HTML tags from components.
Use explicit attribute values (e.g., onMousedown={true}) if you need standard behavior, or rename variables to match attribute names.Consider using Babel's @babel/plugin-transform-react-jsx or similar for standard behavior.
Pass a valid JSX AST object, not a string.
Use const JSX = require('jsx-to-js') instead of import.Use const JSX = require('jsx-to-js') instead.Preparse your JSX string with a parser like jsx-parser or acorn-jsx before passing to JSX().
Ensure all component names are defined as variables in scope; use lowercase for HTML elements if needed.
No dependency data recorded yet.