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 NPM Version Slack

License Build Security Rating Quality Gate Status

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 the SceneGraph framework, 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. Starting with version 2.0 we also expose an extension interface so advanced features can be delivered as optional bundles that plug into the interpreter lifecycle.

This repository is organized as a monorepo that contains three separate packages:

  • brs-engine – core browser/web worker package that provides the BrightScript interpreter for web apps.
  • brs-node – Node.js package that provides a CLI app and the interpreter library for non-browser platforms.
  • brs-scenegraph – Roku SceneGraph extension package that adds support for RSG components and nodes.

Note

  • The SceneGraph support is currently in development, and released as an experimental feature. 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, PWAs, 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 and roSGScreen 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

⚙️ Extension Packages

  • brs-scenegraph – ships the SceneGraph runtime as a standalone extension that loads automatically whenever a Roku app contains pkg:/components/ assets.
  • Roku SDK1 compatibility (planned) – upcoming extension focused on legacy SDK1 channels and their APIs.
  • BrightSign runtime (planned) – upcoming extension to add support for BrightSign-specific components and hardware features.

Read more about the shared extension model in docs/extensions.md.

📚 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-2026 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 21