📜 ⬆️ ⬇️

[Translation] News from the world of Node: Tint, Redbird

Tint


image

Today, we can state the rise of such a sub-field of node-oriented development as writing desktop applications on node-webkit or similar frameworks. The idea of ​​this approach looks quite simple: we pack the Node runtime with a small program that is designed to run your Node application as if it were native, desktop.


')
Tint is an alternative. It uses a modified version of Node that is tied to native components, this implies that you can develop JavaScript native components of osx * , such as windows, buttons, embedded web view, dialogs, and more.

The company involved in this project releases it under the MIT license. If you are an Objective-C developer you might find Main_mac.mm interesting, it is an integration of Node event loops with Objective-C ++ .

I collected the whole thing from source and created a small test application to look at what APIs in Tint look like.

require('Application'); var Window = require('Window'); var Button = require('Button'); var mainWindow = new Window(); var button = new Button(); mainWindow.title = 'DailyJS'; button.title = 'Hello'; button.addEventListener('mousedown', function() { button.title = '^_^'; }); button.addEventListener('mouseup', function() { button.title = 'Hello'; }); mainWindow.appendChild(button); mainWindow.addLayoutConstraint({ priority: 'required', relationship: '=', firstItem: button, firstAttribute: 'top', secondItem: mainWindow, secondAttribute: 'bottom', multiplier: 0.0, constant: 0.0 }); setInterval(function() { button.title = Math.random(); }, 1000); 

I ran the script with ./build/Release/tint example.js and got a window with a button. I wrote this script looking at test examples in order to familiarize myself with the functionality.

It seems to me that this is a cool project and I really would like to execute a real osx application using Tint, but today I have no idea how to build my project so that the final users would not have smut with the installation of my application. I will continue to play with this framework and try to write more detailed help if I find something useful.

Redbird


Another project for today is Redbrid , which is available under the BSD license and is known in npm as redbird . This project is a reverse proxy for working with virtual dynamic hosts, load balancing, web socket proxying and SSL encryption.

 var proxy = require('redbird')({port: 80}); // Route to any global ip proxy.register('optimalbits.com', 'http://167.23.42.67:8000'); // Route to any local ip, for example from docker containers. proxy.register('example.com', 'http://172.17.42.1:8001'); 


The project documentation includes a complete example with SSL encryption and the authors plan support for load balancing ** and filtering by IP address.

Translator's Notes


* At the time of writing, Tint only worked with osx, support for other operating systems was only planned.
** Probably we are talking about incomplete support with subsequent improvement.

Source: https://habr.com/ru/post/235639/


All Articles