npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@rokucommunity/brs

v0.47.0

Published

An interpreter for the BrightScript language that runs on non-Roku platforms.

Downloads

9

Readme

Table of Contents generated with DocToc

BRS: Off-Roku BrightScript

An interpreter for the BrightScript language that runs on non-Roku platforms.

build status coverage status monthly downloads npm version license Slack

NOTE: Development on the original brs project stalled in September of 2021. We at RokuCommunity believe in the vision of brs, so after some discussions with the original author, we decided to fork the project in order to ensure its continued development.

Installation

The BRS project is published as a node package, so use npm:

$ npm install -g @rokucommunity/brs

Usage

This repo provides the brs executable, which operates in two ways.

REPL

An interactive BrightScript REPL (Read-Execute-Print Loop) is available by running brs with no arguments, e.g.:

$ brs
brs> ?"Dennis Ritchie said ""Hello, World!"""
Dennis Ritchie said "Hello, World!"

Quit by pressing ^D (Control-D) or executing exit.

Executing a file

BRS can execute an arbitrary BrightScript file as well! Simply pass the file to the brs executable, e.g.:

$ cat hello-world.brs
?"Dennis Ritchie said ""Hello, World!"""

$ brs hello-world.brs
Dennis Ritchie said "Hello, World!"

Sure, but why?

The Roku series of media streaming devices are wildly popular amongst consumers, and several very popular streaming services offer Channels for the Roku platform. Unfortunately, Roku chanels must be written in a language called BrightScript, which is only executable directly on a Roku device. BRS hopes to change that by allowing Roku developers to test their code on their own machines, thus improving the quality of their channels and the end-user's experience as a whole.

So can I use this to watch TV without a Roku?

Nope! The BRS project currently has no intention of emulating the Roku user interface, integrating with the Roku store, or emulating content playback. In addition to likely getting this project in legal trouble, that sort of emulation is a ton of work.

Building from source

The BRS project follows pretty standard node development patterns, with the caveat that it uses yarn for dependency management.

Prerequisites

BRS builds (and runs) in node, so you'll need to install that first.

Setup

  1. Clone this repo:

    $ git clone https://github.com/rokucommunity/brs.git
  2. Install dependencies:

    $ npm install
  3. Get brs onto your PATH:

    $ npm link

The build-test-clean dance

Build

This project is written in TypeScript, so it needs to be compiled before it can be executed. npm run build compiles files in src/ into JavaScript and TypeScript declarations, and puts them in lib/ and types/ respectively.

$ npm run build

$ ls lib/
index.js (and friends)

$ ls types/
index.d.ts (and friends)

Alternatively, you can run the build step in "watch" mode. This will run npm run build for you automatically, every time it detects source file changes:

$ npm run watch

This is often useful for testing that local changes work in your BrightScript project, without having to run npm run build over and over.

Testing

Tests are written in plain-old JavaScript with Facebook's Jest, and can be run with the test target:

$ npm run test

# tests start running

Note that only test files ending in .test.js will be executed by yarn test.

Cleaning

Compiled output in lib/ and types/ can be removed with the clean target:

$ npm run clean

$ ls lib/
ls: cannot access 'lib': No such file or directory

$ ls types/
ls: cannot access 'types': No such file or directory

Documentation

For the most part, brs attempts to emulate BrightScript as closely as possible. However, as a work in progress, there are certain implementation gaps, please refer to the BrightScript language reference and report an issue for any gaps found. Also, in the spirit of unit testing, there are a few extensions that will help with testing. All of the roca documentation for APIs, extensions, gaps, and more is hosted on the docs site, hulu.github.io/roca.