Skip to content

lvcabral/brs-engine

Repository files navigation

BrightScript Simulation Engine

An interpreter for the BrightScript language that runs Roku apps on browser platforms and Node.js.

NPM Version NPM Version License Build Quality Gate Status Slack

The Project

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.

📦 Browser Platforms Package

Simulator Web and Desktop

For web applications, browser extensions, and Electron apps

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

Installation

npm install brs-engine

📖 Browser Package: More details | 🚀 Live Demo | 🧑‍💻 Code Playground | 🖥️ Desktop App

📦 Node.js and CLI Package

Simulator CLI

For command-line tools, automation, and server-side execution

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

Installation

# for global CLI installation
npm install -g brs-node

# for project installation
npm install brs-node

📖 Node.js Package: More details | ⌨️ CLI Guide

📚 Project Documentation

There are many ways you can use and/or participate in the project, read the documents below to learn more:

Changelog

  • Click here to view the release changelog.

🔗 Developer Links

📄 License

Copyright © 2019-2025 Marcelo Lv Cabral. All rights reserved.

Licensed under the MIT license.

About

BrightScript Simulation Engine - Run Roku apps on Browsers and Node.js

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 20