yunitto

0.8.1 • Public • Published

Status: Beta

Yunitto

A multi-backend rendering engine for nodejs. Yunitto allows applications to interact with one simple canvas or html interface for rendering to the users screen, or other backend devices. (web browsers and so on).

About

Yunitto provides everything for an app that wants to render to multiple viewports over multiple interfaces. This will be most useful if creating nodejs window managers. It has no dependency on other systemd like X, as it itself a collection of renderers that can be used via one common interface. The current back-ends implemented are:

  • Remote Web Browsers
  • Linux Frame Buffers

Installation

npm install --save yunitto

Usage

Lets import the module with require, and create a new renderer. var Yunitto = require('yunitto'); var yunitto = new Yunitto({ httpport: 16204 });

There should never be more than one renderer running on a device or they will clash in certain instances. (web agents may not clash) Next, lets instruct Yunitto to automatically detect any screens the user has or may add. yunitto.useAllScreens();

Finally, lets create a handle to work to render our content on the viewport of any screen that connects to the device! yunitto.e.on('loadScreen', function(screen) { screen.setContentType("html"); screen.render({ html: "<h1>Ryutai</h1>" }); });

Yunitto will let you render with an HTML interface or a canvas interface. For this example we use an HTML interface. We call the render command and pass the HTML text. We could have also passed a URL if we wanted to. If you have multiple files and want to serve to the screen, I suggest using the Oneshoot module by piranna.

The loadScreen event fires every time a screen is detected and loaded, so with every new screen our code will set the screens content to html and render Hello World.

The URL format to load a browser page is: http://0.0.0.0:port/#socket_port where 0.0.0.0 is replaced with the URL of the host, port is replaced with port, and the socket_port is replaced with your socket port. By default, this is 28844 (and it's suggested that you leave it as so).

Url Variables

Yunitto has a ACCESS_IP variable that you can substitute in when you're making calls to render urls. This string will be replaced by the IP being used to access Yunitto. This should be used to allow both local and remote users to connect.

Comments, Questions, Concerns (or bugs)

Please report every issue, concern and suggestion on the thread so I can improve Yunitto as much as possible! Happy Coding!

Readme

Keywords

Package Sidebar

Install

npm i yunitto

Weekly Downloads

20

Version

0.8.1

License

GPL-3

Last publish

Collaborators

  • lite20