Please mind that this is currently in development! It is not fast like bun, widely supported like node, im still working on making it better!
TODO: Add support for imports es5 and es6
- Description
- Features
- Prerequisites
- Usage
- Project Structure
- Example
- Installation
- Contributing
- License
V12 is a Rust-based engine designed to process and execute JavaScript and TypeScript files. It uses the Boa JavaScript engine for script execution and provides a simple interface for running scripts and displaying information about the engine.
- TypeScript to JavaScript Conversion: Strips TypeScript types and converts
.ts
files to.js
files. - JavaScript Execution: Executes JavaScript files using the Boa engine.
- Temporary File Management: Creates and deletes temporary JavaScript files generated from TypeScript files.
- Engine Information: Displays information about the V12 engine.
- Debugger: Provides a simple debugger for debugging JavaScript files. Just add the word
debug
to the end of yourV12
command!
V12 examples/test.ts debug
- Rust (latest stable version)
- Cargo (latest stable version)
-
Run a JavaScript file:
cargo run path/to/yourfile.js
-
Run a TypeScript file:
cargo run path/to/yourfile.ts
-
Display engine information:
cargo run version
src/main.rs
: Entry point of the application.src/engine/engine.rs
: Contains theEngine
struct and methods for running and interpreting JavaScript.src/utils/typescript.rs
: Functions for processing TypeScript files.src/utils/helper.rs
: Helper functions for utils and more.src/utils/logutil.rs
: Log util for debugging and logging on V12. (Not the JS/TS being executed)
cargo run examples/test.ts
-
Clone the repository:
git clone https://github.com/Thoq-jar/V12.git cd V12
-
Build the project:
-
cargo build --release
-
Add the executable generated in target/release to your path and reload terminal!
-
Run
v12 version
orV12 version
to confim its installed!
Linux/macOS only install:
rm -rf V12
git clone https://github.com/Thoq-jar/V12.git
cd V12
cargo build --release
sudo rm -rf /usr/local/bin/V12
sudo rm -rf /usr/local/bin/v12
sudo cp target/release/V12 /usr/local/bin/V12
sudo cp target/release/V12 /usr/local/bin/v12
cd ..
rm -rf V12
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License. See the LICENSE
file for details.