An interpreter for the BrightScript language that runs Roku apps on browser platforms and Node.js.
The BrightScript Simulation Engine implements an interpreter for the BrightScript language, that can be embedded in Web, Electron and Node.js applications, or used as a CLI/REPL standalone tool, allowing Roku apps to be executed in several different non-Roku platforms.
Initially the focus was on the support of Draw 2D API components (roScreen
, roCompositor
, roRegion
, etc.) along with the core elements of the BrightScript language, allowing a full Roku app execution over an HTML5 Canvas, but the scope was extended to include simulation of the Roku file system, registry, remote control and the Micro Debugger.
The brs-engine is developed in TypeScript and bundled as a collection of Webpack JavaScript libraries. Since version 1.9.0 the repository was organized as a monorepo that contains two separate packages, each optimized for different use cases.
Note
- The SceneGraph support is currently being developed under a new branch, and released as alpha preview. We have a lot of challenges ahead, feel free to reach out and learn how you can help.
- Although brs-engine runs apps with user interface, it has no intention of emulating the full Roku OS or hardware devices, it is primarily aimed as a development tool for the Roku Community.
- The simulation engine can also to be used as a framework for running BrightScript apps and games in other platforms, like iOS, macOS, Android, Linux and Windows.
- Please check the Current Limitations document for further details on what is still missing or out of scope.
- This repository was originally a fork from brs, a BrightScript command line interpreter.
The browser package provides a complete BrightScript interpreter that runs directly in browser environments with full support for the BrightScript language up to Roku OS version 15.
- Client-side execution - No server required
- Web Worker - Interpreter runs in a Web Worker, optimized for browser performance
- HTML5 Canvas rendering - Full Draw 2D API support
- Audio & Video - Supports media playback via HTML5 Audio and Video elements
- File System Simulation - Virtual file system for Roku apps
- BrightScript Micro Debugger - Step-through debugging capabilities
- Input Simulation - Simulates remote control input for Roku apps both via keyboard and gamepad
npm install brs-engine
📖 Browser Package: More details | 🚀 Live Demo | 🧑💻 Code Playground | 🖥️ Desktop App
The Node.js package includes a complete CLI application, ECP and SSDP servers, and the Simulation Engine Node.js library that provides a powerful environment for running BrightScript applications in a server-side context or in test automation workflows.
- Interactive REPL - Command-line BrightScript shell
- File Execution - Run
.brs
,.zip
, and.bpk
files - ASCII Rendering - Simulates
roScreen
output in the terminal - ECP Server - External Control Protocol implementation
- Package Creation - Build and encrypt
.bpk
files - CI/CD Integration - Perfect for automated testing
# for global CLI installation
npm install -g brs-node
# for project installation
npm install brs-node
📖 Node.js Package: More details | ⌨️ CLI Guide
There are many ways you can use and/or participate in the project, read the documents below to learn more:
- How to build from source
- How add the Engine to a Web Application
- How to run as a Command Line Interface
- How to use the Node.js Library
- How to customize the Engine behavior
- Remote Control Simulation
- BrightScript Engine API reference
- BrightScript Engine Limitations
- How to contribute to this Project
- Click here to view the release changelog.
- My website: https://lvcabral.com
- My threads: @lvcabral
- My Bluesky: @lvcabral.com
- My X/twitter: @lvcabral
- My podcast: PODebug Podcast
- Check my other GitHub repositories
Copyright © 2019-2025 Marcelo Lv Cabral. All rights reserved.
Licensed under the MIT license.