DEV Community

阿豪
阿豪

Posted on

Running QuickJS Engine with Rust on OpenWrt

Installing Dependencies

Install the required build tools and development packages:

opkg install git git-http python3 python3-pip make gcc coreutils-install
Enter fullscreen mode Exit fullscreen mode

Installing CMake

CMake is required for building native dependencies:

pip install cmake
Enter fullscreen mode Exit fullscreen mode

Installing Rust

Install Rust using rustup, the official Rust toolchain installer:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Enter fullscreen mode Exit fullscreen mode

Building and Running QuickJS

Clone the rquickjs-cli test repository:

git clone https://github.com/ahaoboy/rquickjs-cli.git
cd rquickjs-cli/
echo "console.log('hello openwrt')" > test.js
cargo run -- ./test.js
Enter fullscreen mode Exit fullscreen mode

Expected Output

hello openwrt
Enter fullscreen mode Exit fullscreen mode

Top comments (0)