Yesterday, the Google Chrome team introduced Carlo, a web rendering surface for Node applications. Carlo provides rich rendering capabilities powered by the Google Chrome browser to Node applications. Using Puppeteer it is able to communicate with the locally installed browser instance. Puppeteer is also a Google Chrome project that comes with a high-level API to control Chrome or Chromium over the DevTools Protocol.
Why Carlo is introduced?
Carlo aims to show how the locally installed browser can be used with Node out-of-the-box. The advantage of using Carlo over Electron is that Node v8 and Chrome v8 engines are decoupled in Carlo. This provides a maintainable model that allows independent updates of the underlying components. In short, Carlo gives you more control over bundling.
What you can do with Carlo?
Carlo enables you to create hybrid applications that use Web stack for rendering and Node for capabilities. You can do the following with it:
- Using the web rendering stack, you can visualize dynamic state of your Node applications.
- Expose additional system capabilities accessible from Node to your web applications.
- Package your application into a single executable using the command-line interface, pkg.
How does it work?
It’s working involve three steps:
- First, Carlo checks whether Google Chrome is installed locally or not
- It then launches Google Chrome and establishes a connection to it over the process pipe
- Finally, exposes high-level API for rendering in Chrome
In case of those users who do not have Chrome installed, Carlo prints an error message. It supports all Chrome Stable channel, versions 70.* and Node v7.6.0 onwards.
You can install and get started with it by executing the following command:
npm i carlo
Read the full description on Carlo’s GitHub repository.
Read Next
npm at Node+JS Interactive 2018: npm 6, the rise and fall of JavaScript frameworks, and more
Node.js and JS Foundation announce intent to merge; developers have mixed feelings