react-compiler-ap
v3.0.4
Published
π **React Compiler**
Readme
π React Compiler
react-compiler-ap is a CLI tool that allows you to compile and run React code in your local environment. It creates a notebook.js file that stores your code and can be shared or loaded into the react-compiler-ap application on any local machine.
π Features
- Run React Code Locally β Quickly compile and run your React code in a browser.
- Notebook File Generation β Automatically generates a notebook.js file in the directory where the CLI command is executed.
- Code Sharing β Share notebook.js with others who can load and execute it on their local machine.
- Port Customization β Optionally specify the port for the server.
π₯ Installation
Run the package using npx (no installation required):
npx react-compiler-ap serve [--port <port>] [myReactCode.js]
π₯ Usage
1. Run the CLI Command
npx react-compiler-ap serve [--port 3001] [myReactCode.js]
2. Open the Application
After running the command, you will see the following message:
Opened notebook.js. Navigate to http://localhost:4005 to edit the file.
Visit http://localhost:4005 in any browser to start compiling and editing your code.
π How It Works
When the CLI command is executed, a notebook.js file is created in the same directory where the command is run.
The file can be loaded and modified via the browser interface.
If you modify and save your code, the changes are reflected in the notebook.js file.
This file can be shared and executed on any machine that runs react-compiler-ap.
π Sharing the Notebook
Share the notebook.js file with others.
They can load the file by running:
npx react-compiler-ap serve [notebook.js]
β‘οΈ Examples
Run with Default Port
npx react-compiler-ap serve
Opens notebook.js on http://localhost:4005.
Run on Custom Port
npx react-compiler-ap serve --port 3001
Opens notebook.js on http://localhost:3001.
Load Existing File
npx react-compiler-ap serve myReactCode.js
Loads myReactCode.js and opens it on the browser.
π οΈ Requirements
- Node.js (v20+ recommended)
- NPM
π Contributing
Contributions are welcome! If you'd like to contribute or report a bug, please feel free to open an issue or submit a pull request on the GitHub repository.
π§ Support
If you encounter any problems or have questions, please open an issue.
π¦ Package Link
Happy Coding! π
