---
title: BrightScript-JavaScript Migration Guide
slug: develop/brightscript-javascript-migration-guide
docTags: 
createdAt: 2025-03-11T07:07:17.199Z
---

This page describes the mapping between BrightScript and JavaScript APIs. BrightScript functionality is implemented in JavaScript using the [BrightSign JavaScript API](docId\:o2uIyNVKbsyd1qXCvhVCN) and the older [BrightScript-JavaScript objects](docId\:URrXhU7L-V9ea-Zhy0JV3); BrightScript APIs are not ported when standard JavaScript libraries provide equivalent functionality.

If the JavaScript equivalent is "Not available", the functionality is not currently implemented but should be in the future. If the equivalent is "Not applicable", the corresponding BrightScript method would be meaningless in JavaScript or is otherwise unnecessary.

### Global Functions

| **BrightScript API**                        | **JavaScript Equivalent**                                                                                                                                                                                                                                                                              | **Library**               |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------- |
| CreateObject()                              | Not applicable                                                                                                                                                                                                                                                                                         |                           |
| RestartScript()                             | Not applicable                                                                                                                                                                                                                                                                                         |                           |
| RestartApplication()                        | process.exit()                                                                                                                                                                                                                                                                                         | Node.js®                  |
| Sleep()                                     | Not applicable                                                                                                                                                                                                                                                                                         |                           |
| asc()                                       | String.charCodeAt()                                                                                                                                                                                                                                                                                    | JavaScript built-in       |
| chr()                                       | String.fromCharCode()                                                                                                                                                                                                                                                                                  | JavaScript built-in       |
| len()                                       | String.length                                                                                                                                                                                                                                                                                          | JavaScript built-in       |
| str()                                       | Number.toString()                                                                                                                                                                                                                                                                                      | JavaScript built-in       |
| strl()                                      | Number.toString()                                                                                                                                                                                                                                                                                      | JavaScript built-in       |
| val()                                       | Number()                                                                                                                                                                                                                                                                                               | JavaScript built-in       |
| abs()                                       | Math.abs()                                                                                                                                                                                                                                                                                             | JavaScript built-in       |
| atn()                                       | Math.atan()                                                                                                                                                                                                                                                                                            | JavaScript built-in       |
| csng()                                      | Not applicable                                                                                                                                                                                                                                                                                         |                           |
| cdbl()                                      | Not applicable                                                                                                                                                                                                                                                                                         |                           |
| cint()                                      | Not applicable                                                                                                                                                                                                                                                                                         |                           |
| cos()                                       | Math.cos()                                                                                                                                                                                                                                                                                             | JavaScript built-in       |
| exp()                                       | Math.exp()                                                                                                                                                                                                                                                                                             | JavaScript built-in       |
| fix()                                       | Number.toFixed()                                                                                                                                                                                                                                                                                       | JavaScript built-in       |
| int()                                       | Math.trunc()                                                                                                                                                                                                                                                                                           | JavaScript built-in       |
| log()                                       | Math.log()                                                                                                                                                                                                                                                                                             | JavaScript built-in       |
| sgn()                                       | Math.sign()                                                                                                                                                                                                                                                                                            | JavaScript built-in       |
| sgnl()                                      | Math.sign()                                                                                                                                                                                                                                                                                            | JavaScript built-in       |
| sin()                                       | Math.sin()                                                                                                                                                                                                                                                                                             | JavaScript built-in       |
| tan()                                       | Math.tan()                                                                                                                                                                                                                                                                                             | JavaScript built-in       |
| sqr()                                       | Math.sqrt()                                                                                                                                                                                                                                                                                            | JavaScript built-in       |
| Left(target\_string, n)                     | target\_string.substr(0, n)\*                                                                                                                                                                                                                                                                          | JavaScript built-in       |
| Right(target\_string, n)                    | target\_string.substr(target\_string.length - n)\*<br />target\_string.substr(-n)\*                                                                                                                                                                                                                    | JavaScript built-in       |
| StringI()                                   | String.repeat()                                                                                                                                                                                                                                                                                        | JavaScript built-in       |
| Mid(target\_string, start\_position, length | target\_string.substr(start\_position, length)\*                                                                                                                                                                                                                                                       | JavaScript built-in       |
| Instr()                                     | String.indexOf()                                                                                                                                                                                                                                                                                       | JavaScript built-in       |
| GetInterface()                              | Access object interfaces as strings                                                                                                                                                                                                                                                                    |                           |
| Wait()                                      | Not applicable in JavaScript, unless the function is used without reference to ports, and merely to delay execution for a time, in which case, use setTimeout().                                                                                                                                       | JavaScript built-in       |
| ReadAsciiFile()                             | readFileSync()\*\*                                                                                                                                                                                                                                                                                     | Node.js®                  |
| WriteAsciiFile()                            | fs.writeFile()\*\*                                                                                                                                                                                                                                                                                     | Node.js®                  |
| ListDir()                                   | fs.readDir()\*\*                                                                                                                                                                                                                                                                                       | Node.js®                  |
| MatchFiles()                                | fs.readDir()\*\*<br />Additional JavaScript code is needed to complete matching.                                                                                                                                                                                                                       | Node.js®                  |
| LCase()                                     | String.toLowerCase()                                                                                                                                                                                                                                                                                   | JavaScript built-in       |
| UCase()                                     | String.toUpperCase()                                                                                                                                                                                                                                                                                   | JavaScript built-in       |
| DeleteFile()                                | fs.unlink()\*\*                                                                                                                                                                                                                                                                                        | Node.js®                  |
| DeleteDirectory()                           | fs.rmdir()\*\*                                                                                                                                                                                                                                                                                         | Node.js®                  |
| CreateDirectory()                           | fs.mkdir()\*\*                                                                                                                                                                                                                                                                                         | Node.js®                  |
| RebootSystem()                              | system.reboot()                                                                                                                                                                                                                                                                                        | BrightSign JavaScript API |
| ShutdownSystem()                            | Not available                                                                                                                                                                                                                                                                                          |                           |
| UpTime()                                    | OS.uptime()                                                                                                                                                                                                                                                                                            | Node.js®                  |
| FormatDrive()                               | No exact equivalent.                                                                                                                                                                                                                                                                                   |                           |
| EjectDrive()                                | Not available                                                                                                                                                                                                                                                                                          |                           |
| CopyFile()                                  | fs.copyFile()\*\*                                                                                                                                                                                                                                                                                      | Node.js®                  |
| MoveFile()                                  | fs.rename()\*\*                                                                                                                                                                                                                                                                                        | Node.js®                  |
| MapFilenameToNative()                       | Not applicable                                                                                                                                                                                                                                                                                         |                           |
| strtoi()                                    | parseInt()<br />strtoi() parses in base 10, whereas JavaScript supports any base.                                                                                                                                                                                                                      | JavaScript built-in       |
| rnd()                                       | [Math.random()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)                                                                                                                                                                                          | JavaScript built-in       |
| RunGarbageCollector()                       | Not applicable                                                                                                                                                                                                                                                                                         |                           |
| GetDefaultDrive()                           | Not applicable                                                                                                                                                                                                                                                                                         | Node.js®                  |
| SetDefaultDrive()                           | process.chdir()                                                                                                                                                                                                                                                                                        | Node.js®                  |
| EnableZoneSupport()                         | Not applicable                                                                                                                                                                                                                                                                                         |                           |
| EnableAudioMixer()                          | Not applicable                                                                                                                                                                                                                                                                                         |                           |
| Pi()                                        | Math.PI                                                                                                                                                                                                                                                                                                | JavaScript built-in       |
| ParseJson()                                 | JSON.parse()<br />BrightScript returns Invalid in the case of problematic strings, whereas JavaScript throws an exception.                                                                                                                                                                             | JavaScript built-in       |
| FormatJson()                                | JSON.stringify()  <br />JSON.stringify must be invoked with a custom replacer, for example, [Cyclic\_object\_value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cyclic_object_value) or [WebReflection/flatted#flatted](https://github.com/WebReflection/flatted#flatted) | JavaScript built-in       |

\* substr takes parameters as (from, length).
   substring takes parameters as (from, to).
   slice takes parameters as (from, to).

\*\* Async operations are always preferable.

### Core Objects

| **BrightScript API**     | **JavaScript Equivalent**                                                                                                                                                                                                                      | **Library**                                                                                                    |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| roArray                  | Not applicable                                                                                                                                                                                                                                 | [JavaScript built-in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators) |
| roAssociativeArray       | Not applicable                                                                                                                                                                                                                                 | [JavaScript built-in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators) |
| roBoolean                | Not applicable                                                                                                                                                                                                                                 | [JavaScript built-in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators) |
| roByteArray              | Blob()<br />(JavaScript now has [typed arrays](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays) - for example, [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)) |                                                                                                                |
| roDouble                 | Not applicable                                                                                                                                                                                                                                 | [JavaScript built-in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators) |
| roFunction               | Not applicable                                                                                                                                                                                                                                 | [JavaScript built-in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators) |
| roInt, roFloat, roString | Not applicable                                                                                                                                                                                                                                 | [JavaScript built-in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators) |
| roList                   | Use JavaScript built-in function                                                                                                                                                                                                               | [JavaScript built-in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators) |
| roMessagePort            | Not applicable                                                                                                                                                                                                                                 | [JavaScript built-in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators) |
| roRegex                  | RegExp()                                                                                                                                                                                                                                       | [JavaScript built-in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators) |
| roXMLElement             | DOMParser()                                                                                                                                                                                                                                    | [JavaScript built-in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators) |
| roXMLList                | DOMParser()                                                                                                                                                                                                                                    | [JavaScript built-in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators) |

### Presentation Objects&#x20;

| **BrightScript API**                | **JavaScript Equivalent**                                                            | **Library**                                                 |
| ----------------------------------- | ------------------------------------------------------------------------------------ | ----------------------------------------------------------- |
| roAudioEventMx                      | Not available                                                                        |                                                             |
| roAudioOutput                       | [audiooutput](docId\:lXzJ2B4sOLXTNXKXXkOb5)                                          |                                                             |
| roAudioPlayer                       | Use html audio tag                                                                   |                                                             |
| roCanvasWidget                      | Not applicable                                                                       |                                                             |
| roClockWidget                       | Not applicable                                                                       |                                                             |
| roHdmiInputChanged                  | videoinput.VideoInputConfiguration.hdmiinputchanged                                  | [BrightSign JavaScript API](docId\:XDORXW7WvzcNnu2-5UpuY)   |
| roHdmiOutputChanged                 | videooutput.VideoOutputConfiguration.hotplugevent                                    | [BrightSign JavaScript API](docId\:XDORXW7WvzcNnu2-5UpuY)   |
| roHTMLWidget                        | [htmlwidget](docId\:pMpuH3A0VR8OhjoPsJwo7)                                           |                                                             |
| roImageBuffer                       | Not applicable                                                                       |                                                             |
| roImagePlayer                       | [`<img> tag in HTML`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img) |                                                             |
| roImageWidget                       | [`<img> tag in HTML`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img) |                                                             |
| roRectangle                         | Not applicable                                                                       |                                                             |
| roStreamQueue                       | Not available                                                                        |                                                             |
| roTextField                         | Not applicable                                                                       |                                                             |
| roTextWidget                        | Not applicable                                                                       |                                                             |
| roTouchEvent                        | TouchEvent()                                                                         | Web API                                                     |
| roTouchScreen                       | Not available                                                                        |                                                             |
| SetResolution()                     | Browser performs mapping                                                             |                                                             |
| AddRectangle()                      | Map CSS cursor properties to hardware cursor                                         |                                                             |
| AddCircleRegion()                   | Map CSS cursor properties to hardware cursor                                         |                                                             |
| ClearRegions()                      | Not applicable                                                                       |                                                             |
| GetDeviceName()                     | Not applicable                                                                       |                                                             |
| SetCursorPosition()                 | Simulate mouse cursor events in JavaScript                                           |                                                             |
| SetCursorBitmap()                   | Map CSS cursor properties to hardware cursor                                         |                                                             |
| EnableCursor()                      | Map CSS cursor properties to hardware cursor                                         |                                                             |
| EnableRollover()                    | Not applicable                                                                       |                                                             |
| EnableRegion()                      | Map CSS cursor properties to hardware cursor                                         |                                                             |
| SetRollOverOrigin()                 | Map CSS cursor properties to hardware cursor                                         |                                                             |
| IsMousePresent()                    | pointer.isMousePresent()                                                             | [BrightSign JavaScript API](docId\:wydFi-OEWp1UOFQJVyHhU)   |
| SetMouseRotation()                  | Not applicable                                                                       |                                                             |
| EnableSerialTouchscreen()           | Not available                                                                        |                                                             |
| SetSerialTouchscreenConfiguration() | Not available                                                                        |                                                             |
| GetDiagnosticInfo()                 | pointerCalibration.getDiagnosticInfoHTML()                                           | [BrightSign JavaScript API](docId\:wydFi-OEWp1UOFQJVyHhU)   |
| StartCalibration()                  | pointerCalibration.startCalibration()                                                | [BrightSign JavaScript API](docId\:wydFi-OEWp1UOFQJVyHhU)   |
| GetCalibrationStatus()              | pointerCalibration.getCalibrationStatus()                                            | [BrightSign JavaScript API](docId\:wydFi-OEWp1UOFQJVyHhU)   |
| ClearStoredCalibration()            | pointerCalibration.clearStoredCalibration()                                          | [BrightSign JavaScript API](docId\:wydFi-OEWp1UOFQJVyHhU)   |
| StartEventLogging()                 | pointerCalibration.startEventLogging()                                               | [BrightSign JavaScript API](docId\:wydFi-OEWp1UOFQJVyHhU)   |
| StopEventLogging()                  | pointerCalibration.stopEventLogging()                                                | [BrightSign JavaScript API](docId\:wydFi-OEWp1UOFQJVyHhU)   |
| ClearEventLogs()                    | Not applicable (no information on the log)                                           |                                                             |
| SetCalibrationRanges()              | pointerCalibration.setCalibrationRanges()                                            | [BrightSign JavaScript API](docId\:wydFi-OEWp1UOFQJVyHhU)   |
| roVIdeoInput                        | MediaDevices.getUserMedia()                                                          | Web API                                                     |
| roVideoMode                         | [videomodeconfiguration](docId\:uupZxkYFlBSOLyh8oLcES)                               |                                                             |
| SetMode()                           | videomodeconfiguration.setMode()                                                     | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| SetModeForNextBoot()                | Not applicable (use @brightsign/videomodeconfiguration SetMode())                    |                                                             |
| GetModeForNextBoot()                | Not applicable (use @brightsign/videomodeconfiguration getActiveMode())              |                                                             |
| GetBestMode()                       | videomodeconfiguration.getBestMode()                                                 | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetMode()                           | videomodeconfiguration.getActiveMode()                                               | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetActiveMode()                     | videomodeconfiguration.getActiveMode()                                               | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetAvailableModes()                 | videomodeconfiguration.getAvailableModes()                                           | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetConfiguredMode()                 | videomodeconfiguration.getConfiguredMode()                                           | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetFPS                              | videomodeconfiguration.getActiveMode()                                               | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| SetDecoderMode()                    | decoderconfiguration.applyConfig()                                                   | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetDecoderModes()                   | decoderconfiguration.getConfig()                                                     | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| Set3DMode()                         | videooutput.set3dMode()                                                              |                                                             |
| Screenshot()                        | screenshot.syncCapture()/asyncCapture()                                              | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetResX()                           | videomodeconfiguration.Mode.graphicsPlaneWidth                                       | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetRexY()                           | videomodeconfiguration.Mode.graphicsPlaneHeight                                      | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetVideoResX()                      | videomodeconfiguration.Mode.width                                                    | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetVideoResY()                      | videomodeconfiguration.Mode.height                                                   | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetOutputResX()                     | videooutput.Size.width                                                               | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetOutputResY()                     | videooutput.Size.height                                                              | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetSafeX()                          | BSVideoMode.safeX                                                                    | BS-JavaScript objects                                       |
| GetSafeY()                          | BSVideoMode.safeY                                                                    | BS-JavaScript objects                                       |
| SafeWidth()                         | BSVideoMode.safeWidth                                                                | BS-JavaScript objects                                       |
| SafeHeight()                        | BSVideoMOde.safeHeight                                                               | BS-JavaScript objects                                       |
| SetGraphicsZOrder                   | Not applicable                                                                       |                                                             |
| PauseGraphics()                     | compositor.pause()                                                                   | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| ResumeGraphics()                    | compositor.resume()                                                                  | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| SetImageSizeThreshold()             | system.setImageSizeThreshold()                                                       | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| AdjustGraphicsColor()               | videooutput.adjustGraphicColor()                                                     |                                                             |
| ConfigureHdmiInput()                | videoinput.ApplyConfig()                                                             | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| SetHdmiMetadata()                   | Not available and possibly not applicable                                            |                                                             |
| GetHdmiOutputStatus()               | videooutput.getOutputStatus()                                                        | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetHdmiInputStatus()                | videoinput.getStatus()                                                               | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetCompositorCrc()                  | compositor.getCrc()                                                                  | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| GetTxHdcpStatus()                   | videooutput.getTxHdcpStatus()                                                        | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| ForceHdcpOn()                       | videooutput.forceHdcpOn()                                                            | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| DisableHdcpRepeater()               | videooutput.DisableHdcpRepeater()                                                    |                                                             |
| SetBackgroundColor()                | videooutput.setBackgroundColor()                                                     | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| SetPowerSaveMode()                  | videooutput.SetPowerSaveMode()                                                       | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| IsAttached()                        | videooutput.isAttached()                                                             | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| HdmiAudioDisable()                  | videooutput.disableAudio()                                                           | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| SetMultiscreenBezel()               | videooutput.setMultiscreenBezel()                                                    | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| SaveEdids()                         | videooutput.getEdid() returns EDID information as a hex-encoded string.              |                                                             |
| GetEdidIdentity()                   | videooutput.getEdidIdentity()                                                        | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| SetMpcdi()                          | videooutput.setMpcdi()                                                               |                                                             |
| SetSyncDomain()                     | videooutput.setSyncDomain()                                                          | [BrightSign JavaScript API](docId\:QQ734nQz0hCwNI0uNSdMP)   |
| roVideoPlayer                       | Use \<video> elements with [BrightSign properties](docId\:e6uJleH69Q0JmMv8kyTrp)     |                                                             |

### File Objects

Use the Node.js File API.

### Hashing and Storage Objects

| **BrightScript API** | **JavaScript Equivalent**                                                                       | **Library**                                                   |
| -------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| roBlockCipher        | Node.js Crypto API                                                                              |                                                               |
| roBrightPackage      | Node.js Zlib API                                                                                |                                                               |
| roDiskErrorEvent     | Not available                                                                                   |                                                               |
| roDiskMonitor        | Not available                                                                                   |                                                               |
| roHashGenerator      | Node.js Crypto API                                                                              |                                                               |
| roPassKey            | Node.js Crypto API                                                                              |                                                               |
| roRegistry           | [registry](docId\:tXWoOMbD2-u12dfegX7gA)                                                        |                                                               |
| GetSectionList()     | registry.read()                                                                                 | [BrightSign JavaScript API](docId\:YTpSfntswYFMXx8PCqJLf)     |
| Delete()             | registry.write()                                                                                | [BrightSign JavaScript API](docId\:YTpSfntswYFMXx8PCqJLf)     |
| Flush()              | Not applicable; registry writes are flushed implicitly                                          |                                                               |
| roRegistrySection    | [registry](docId\:tXWoOMbD2-u12dfegX7gA)                                                        |                                                               |
| Read()               | registry.read()                                                                                 | [BrightSign JavaScript API](docId\:FfM73tjd_BThW4-P-0JVG)     |
| Write()              | registry.write()                                                                                | [BrightSign JavaScript API](docId\:FfM73tjd_BThW4-P-0JVG)     |
| Exists()             | Not applicable (Use read followed by a truthy check on the registry key)                        |                                                               |
| GetKeyList()         | Not applicable (Use read followed by Object.keys())                                             |                                                               |
| roSqliteDatabase     | Use IndexedDB                                                                                   |                                                               |
| roSqliteStatement    | Use IndexedDB                                                                                   |                                                               |
| roStorageAttached    | node.js fs.watch()                                                                              |                                                               |
| roStorageDetached    | node.js fs.watch()                                                                              |                                                               |
| roStorageHotplug     | node.js fs.watch()                                                                              |                                                               |
| roStorageInfo        | [filesysteminfo](docId\:QulnL7zrhwc5FGokcGAi7) and [storageinfo](docId\:RoZ3o77EuxtyZvj_dSPin)  |                                                               |
| GetBytesPerBlock()   | filesysteminfo.getStatistics()                                                                  | [BrightSign JavaScript API ](docId\:BczooenmOIfNRbeny6ZKI)    |
| GetSizeInMegabytes() | filesysteminfo.getStatistics()                                                                  | [BrightSign JavaScript API](docId\:BczooenmOIfNRbeny6ZKI)     |
| GetUsedInMegabytes() | node.js fs.stat()                                                                               |                                                               |
| GetFreeInMegabytes() | filesysteminfo.getStatistics()                                                                  | [BrightSign JavaScript API](docId\:BczooenmOIfNRbeny6ZKI)     |
| GetFileSystemType()  | filesysteminfo.getFileSystemType()                                                              | [BrightScript JavaScript API](docId\:BczooenmOIfNRbeny6ZKI)   |
| GetStorageCardInfo() | storageinfo.getStorageCardInfo()                                                                | [BrightScript JavaScript API](docId\:BczooenmOIfNRbeny6ZKI)   |
| roVirtualMemory      | Not available                                                                                   |                                                               |

### Content Management Objects

| **BrightScript API** | **JavaScript Equivalent**                        | **Library**                                                 |
| -------------------- | ------------------------------------------------ | ----------------------------------------------------------- |
| roAssetCollection    | Not available                                    |                                                             |
| roAssetFetcher       | [assetpoolfetcher](docId\:hg03EuSH_xKKpfoFWdgCz) | [BrightSign JavaScript API](docId:1aQOGvXANa1wfJWf8tHmd)    |
| roAssetPool          | [assetpool](docId\:NY8nhRk1-740WPRYL_p8d)        | [BrightSign JavaScript API](docId\:dz9ZC0Ke6JLQnIbuNuq0n)   |
| roAssetPoolFiles     | [assetpoolfiles](docId\:NhoCAmfrJ0AvAHJ-Vearr)   |                                                             |
| roAssetRealizer      | [assetrealizer](docId\:xnl0us14GWG7EUIz2XSDm)    | [BrightSign JavaScript API](docId\:yoV_QcUTleNArbM-FZMfv)   |
| roSyncSpec           | Not applicable                                   |                                                             |

### Networking Objects

| **BrightScript API**                                          | **JavaScript Equivalent**                                                      | **Library**                                                   |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------- |
| roDatagramReceiver                                            | Node.js Dgram API                                                              |                                                               |
| roDatagramSender                                              | Node.js Dgram API                                                              |                                                               |
| roDatagramSocket                                              | Node.js Dgram API                                                              |                                                               |
| roHttpServer                                                  | Node.js                                                                        |                                                               |
| roKeyStore                                                    | [keystore](docId:6Alp0AIXrZlHV4cBkebvz)                                        | [BrightScript JavaScript API](docId\:GhSZNW9eS8TEMURQXq-DU)   |
| roMediaServer                                                 | node-media-server                                                              |                                                               |
| roMediaStreamer                                               | Not available                                                                  |                                                               |
| roMimeStream                                                  | Not applicable                                                                 |                                                               |
| roNetworkAdvertisement                                        | Not applicable (use node.js)                                                   |                                                               |
| roNetworkConfiguration                                        | [networkconfiguration](docId:6MS7rdjWWhP21clMeDRwv)                            |                                                               |
| Apply()                                                       | networkconfiguration.applyConfig()                                             | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetupDWS()                                                    | dwsconfiguration                                                               | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| EnableLEDs()                                                  | networkconfiguration.enableLeds()                                              | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetClientIdentifier()                                         | networkconfiguration.NetworkInterfaceConfig.clientIdentifier                   | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| GetClientIdentifier()                                         | networkconfiguration.NetworkInterfaceConfig.clientIdentifier                   | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetLoginPassword()                                            | hostconfiguration.HostConfigWritable.loginPassword                             | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetObfuscatedLoginPassword()                                  | hostconfiguration.HostConfigWritable.ObfuscatedLoginPassword                   | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetInboundShaperRate()                                        | networkconfiguration.NetworkInterfaceConfig.inboundShaperRate                  | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetMTU()                                                      | networkconfiguration.NetworkInterfaceConfig.mtu                                | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetRoutingMetric()                                            | networkconfiguration.NetworkInterfaceConfig.metric                             | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetDHCP()                                                     | networkconfiguration.NetworkInterfaceConfig.ipAddressList                      | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetEnabledProtocols()                                         | networkconfiguration.NetworkInterfaceConfig.enabledProtocolList                | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetIP4Address()                                               | networkconfiguration.NetworkInterfaceConfig.ipAddressList                      | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetIP4Netmask()                                               | networkconfiguration.NetworkInterfaceConfig.ipAddressList                      | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetIP4Broadcast()                                             | networkconfiguration.NetworkInterfaceConfig.ipAddressList                      | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetIP4Gateway()                                               | networkconfiguration.NetworkInterfaceConfig.ipAddressList                      | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetVlanIds()                                                  | networkconfiguration.NetworkInterfaceConfig.vlanIdList                         | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetWiFiESSID()/.GetWiFiESSID()                                | networkconfiguration.WiFiInterfaceConfig.essId                                 | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetWiFiPassphrase()                                           | networkconfiguration.WiFiInterfaceConfig.passphrase                            | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetWiFiPassphraseAndObfuscate()                               | networkconfiguration.WiFiInterfaceConfig.obfuscatedPassphrase                  | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetWiFiAccessPointMode()                                      | networkconfiguration.WiFiInterfaceConfig.accessPointMode                       | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetAccessPointFrequencyMHz()                                  | networkconfiguration.WiFiInterfaceConfig.accessPointFrequency                  | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetWiFiIdentity()                                             | networkconfiguration.WiFiInterfaceConfig.identity                              | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetWiFiEapTlsOptions()                                        | networkconfiguration.WiFiInterfaceConfig.eapTlsOptions                         | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetWiFiCACertificates()                                       | networkconfiguration.WiFiInterfaceConfig.caCertificates                        | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetWiFiClientCertificate()                                    | networkconfiguration.WiFiInterfaceConfig.clientCertificate                     | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetWiFiPrivateKey()                                           | networkconfiguration.WiFiInterfaceConfig.privateKey                            | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetWiFiSecurityMode()                                         | networkconfiguration.WiFiInterfaceConfig.securityMode                          | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| ConfigureDHCPServer()                                         | networkconfiguration.NetworkInterfaceConfig.dhcpServerConfig                   | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetForwardingPolicy()                                         | Not available                                                                  |                                                               |
| SetDNSServers()/.AddDNSServer()                               | networkconfiguration.NetworkInterfaceConfig.dnsServerList                      | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetTimeServer()                                               | hostconfiguration.HostConfig.timeServerList                                    | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetTimeServerIntervalSeconds()/ GetTimeServerIntervalSecons() | hostconfiguration.HostConfig.timeServerInterval                                | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetHostName()/.GetHostName()                                  | hostconfiguration.HostConfig.hostName                                          | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetProxy()/.GetProxy()                                        | hostconfiguration.HostConfig.proxy                                             | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| SetProxyBypass()/.GetProxyBypass()                            | hostconfiguration.HostConfig.proxyBypassList                                   | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| GetRecoveryUrl()                                              | Not available                                                                  |                                                               |
| ResetInterfaceSettings()                                      | networkconfiguration.applyConfig()                                             | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| ResetHostSettings()                                           | hostconfiguration.applyConfig()                                                | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| GetCurrentConfig()                                            | networkconfiguration.getConfig()/hostconfiguration.getConfig()                 | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| TestInterface()                                               | networkdiagnostics.testNetworkInterface()                                      | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| TestInternetConnectivity()                                    | networkdiagnostics.testInternetConnectivity()                                  | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| GetNeighborInformation()                                      | networkconfiguration.getNeighborInformation()                                  | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| ScanWiFi()                                                    | networkconfiguration.scan()                                                    | [BrightScript JavaScript API](docId\:U6ZceYQddlz9xdAKtTmJs)   |
| roNetworkHotplug                                              | [networkhotplug](docId\:NEizLJQNwCice75OcWKoL)                                 |                                                               |
| roNetworkAttached                                             | [networkhotplug](docId\:NEizLJQNwCice75OcWKoL)                                 |                                                               |
| roNetworkDetached                                             | [networkhotplug](docId\:NEizLJQNwCice75OcWKoL)                                 |                                                               |
| roNetworkDiscovery                                            | Not applicable (node.js can be used instead)                                   |                                                               |
| roNetworkStatistics                                           | Not applicable (See node module net-stat)                                      |                                                               |
| roPtp                                                         | [hostconfiguration](docId\:P1DkloQhLM9wxsSwmPeeK) (see OS 8.0.94 release note) |                                                               |
| roRssArticle/roRssParser                                      | Not applicable                                                                 |                                                               |
| roRtspStream                                                  | Use \<video> elements                                                          |                                                               |
| roSnmpAgent                                                   | net-snmp                                                                       | npm\*\*\*                                                     |
| roStream                                                      | Not applicable                                                                 |                                                               |
| roSyncManager                                                 | [BSSyncManager](docId\:DQNX2ot2TDKXYNmRGLNCP)                                  | BS-JavaScript objects                                         |
| roTCPServer/roTCPStream                                       | net.socket                                                                     | Node.js®                                                      |
| roUPnP                                                        | Not applicable                                                                 |                                                               |
| roUrlTransfer                                                 | http                                                                           | Node.js®                                                      |

\*\*\* npm is a registered trademark of npm, Inc.

### Input/Output Objects

| **BrightScript API**         | **JavaScript Equivalent**                       | **Library**                                                  |
| ---------------------------- | ----------------------------------------------- | ------------------------------------------------------------ |
| roBtManager                  | [BSBtManager](docId\:Cf7q7xSA9dRtCq3bTXV-A)     | BS-JavaScript objects                                        |
| roBtClientManager/roBtClient | [BSBtManager](docId\:Cf7q7xSA9dRtCq3bTXV-A)     |                                                              |
| roCecInterface               | [cec](docId\:sgfokqfxwmjxxOfS13HtK)             |                                                              |
| roChannelManager             | obsolete                                        |                                                              |
| roControlPort                | [controlport](docId\:N8yoCsdAGOgqCP1OyuoLw)     | BS-JavaScript objects                                        |
| roGpioControlPort            | [controlport](docId\:N8yoCsdAGOgqCP1OyuoLw)     | BS-JavaScript objects                                        |
| roIRReceiver                 | [BSIRReceiver](docId\:W5oQmfTxhlg8lwisWtg7r)    | BS-JavaScript objects                                        |
| roIRTransmitter              | [BSIRTransmitter](docId\:OG4yl3PeFza5nKGKbgBLv) | BS-JavaScript objects                                        |
| roIRRemote                   | BSIRRemote                                      |                                                              |
| roKeyboard                   | [keyboard](docId\:mNJv4RN7rm_2FSlSjTqgc)        | [BrightScript-JavaScript API](docId\:VNJf6GnS75_lMizET3b1y)  |
| roSequenceManager            | Not applicable                                  |                                                              |
| roSerialPort                 | [BSSerialPort](docId\:ZMQun8ZM06AoSriD6EsfB)    | BS-JavaScript objects                                        |

### System Objects

| **BrightScript API**  | **JavaScript Equivalent**                    | **Library** |
| --------------------- | -------------------------------------------- | ----------- |
| roDeviceCustomization | Not available                                |             |
| roDeviceInfo          | [BSDeviceInfo](docId\:s5S40P5KDiRwX7euJzSBa) |             |
| roResourceManager     | Not applicable                               |             |
| roSystemLog           | Not available                                |             |

### Date and Time Objects

| **BrightScript API** | **JavaScript Equivalent**                   | **Library**                                                 |
| -------------------- | ------------------------------------------- | ----------------------------------------------------------- |
| roDateTime           | Date                                        | JavaScript built-in                                         |
| roSystemTime         | [systemtime](docId\:pwLrn-rjiHDHgwl2TBwC0)  | [BrightScript JavaScript API](docId\:HWR0ZojGTZxXnUHDLHlf9) |
| roTimer              | .setTimeout()/.setInterval()                | Web API                                                     |
| roTimeSpan           | Date                                        | JavaScript built-in                                         |

