multi-framework-component-transpiler

raw JSON →
1.0.2 verified Fri May 01 auth: no javascript

A CLI tool that transpiles plain JavaScript or framework-specific components into multiple frontend frameworks: React, Vue, Svelte, Angular, and Vanilla JS. Version 1.0.2 is the initial release. It reads input files (.js, .ts, .jsx, .tsx, .vue, .svelte) and outputs framework-ready components with appropriate lifecycle hooks (useEffect, onMounted, onMount, ngOnInit). Supports both JavaScript and TypeScript output. Intended for code migration or multi-framework component generation, but lacks modular architecture, error handling, and active maintenance. Differentiators: multi-framework output from a single input, but limited customization and no plugin system.

error Error: Cannot find module 'multi-framework-component-transpiler'
cause Package not installed when using global command without npx.
fix
Run with npx: npx multi-framework-component-transpiler <inputFile> [outputDir]
error TypeError: inputFile is not a string
cause Missing or invalid input file argument.
fix
Provide a valid input file path as first argument.
error Error: Unsupported file extension: .xyz
cause Input file has unsupported extension.
fix
Use one of: .js, .ts, .jsx, .tsx, .vue, .svelte
gotcha The tool does NOT parse complex code structures; only top-level function declarations and simple statements are transpiled. Classes, async/await, or module imports may be dropped or mis-handled.
fix Review generated output for missing code; manually refactor complex patterns.
gotcha Output file names can cause conflicts: underscores in input filenames may lead to duplicate component names across frameworks.
fix Use clear, unique input file names or manually rename output files.
gotcha The CLI overwrites output directory without warning if it exists.
fix Specify a non-existent or empty output directory, or back up contents.
gotcha Only UTF-8 encoded files are supported; other encodings may produce corrupted output.
fix Ensure input files are UTF-8 encoded.
npm install multi-framework-component-transpiler
yarn add multi-framework-component-transpiler
pnpm add multi-framework-component-transpiler

Transpiles input.js into React, Vue, Svelte, Angular, and Vanilla JS components in ./output.

npx multi-framework-component-transpiler input.js ./output