Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@builder.io/mitosis-cli

Package Overview
Dependencies
Maintainers
15
Versions
314
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@builder.io/mitosis-cli

mitosis CLI

  • 0.2.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.3K
increased by3.6%
Maintainers
15
Weekly downloads
 
Created
Source

Mitosis CLI

A CLI for Mitosis.

Installation

npm install -g @builder.io/mitosis-cli

Usage

mitosis compile --to=<format> < <input-file>
cat my-file.tsx | mitosis compile -t=<format>
mitosis compile -t=<format> <input-file>

Check the output from mitosis compile --help.

Examples

mitosis compile -t react component.tsx
mitosis compile -t react < component.tsx
cat component.tsx | mitosis compile -t html -
mitosis compile -t react --out-dir build -- src/**/*.tsx

Options

Supported formats for --to are:

  • reactNative
  • solid
  • vue
  • react
  • template
  • html
  • customElement
  • mitosis
  • builder
  • swift
  • svelte
  • liquid
  • angular

Supported formats for --from are:

  • mitosis
  • builder
  • liquid

Cook book

Here are some recipes for standard tasks

Validate how Builder will transform Mitosis

cat components/postscript.lite.tsx |
  mitosis compile -t builder - |
  mitosis compile -f builder -t mitosis

Run mitosis on file system change

Use a tool like entr or guard

find . -name '*lite.tsx' | entr make /_

Known issues

  • Running mitosis from the root of this repository breaks due to some dynamic babel configuration look up
  • Files that are created as the result of --out-dir=<dir> maintain the original file extension of the input file, which doesn't make any sense in the case of an html output.
  • --out=<file> does not support concatenating multiple files together.

FAQs

Package last updated on 30 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc