JS Service Basics

What is a webOS JavaScript Service?

JavaScript services (JS services) on webOS provide the way for apps to do work, even when the app isn't running. They also provide access to platform features that aren't usually available to web apps.

JS service on webOS TV has the following characteristics:

  • It is written in JavaScript and created using Node.js.

  • It runs in the background on webOS TV.

  • It provides additional access to platform features such as low-level networking, file system access, and binary data processing.

  • It performs tasks for one or more apps.

Use Cases for webOS JavaScript Services 

Typically you will use a service either to perform tasks that a webOS app can't do or to do work by service in the background. Some examples of how services have been used in webOS apps in the past include:

  • Downloading attachments in the background for an email reader

  • Uploading images to a picture-sharing website from an app

  • Performing a long-running computation or file operation

About Node.js

Node.js was created as a framework for server-side JavaScript applications. Services in webOS are not quite like web application servers (in particular, because they don't stay running all of the time), but the basic framework of an asynchronous I/O and network stack makes much sense as an extension of the webOS app environment.

You can find out more about Node.js on the Node.js website.