Giter Site home page Giter Site logo

carlo's Introduction

Carlo

Carlo provides your Node application with the rich rendering capabilities powered by the Google Chrome browser.

image

What can I do?

With Carlo, you can create hybrid applications that use Web stack for rendering and Node for capabilities:

  • For Node applications, you can visualize dynamic state of your Node app using web rendering stack
  • For Web applications, you can expose additional system capabilities accessible from Node
How does it work?
  • Carlo locates Google Chrome installed locally
  • Launches it and establishes connection to Chrome over the process pipe
  • Exposes high level API for rendering in Chrome in Node environment
  • Carlo is based on the Puppeteer project

Getting Started

Installation

To use Carlo in your project, run:

npm i carlo
# or "yarn add carlo"

Usage

Note: Carlo requires at least Node v7.6.0.

Example - Visualize local environment:

Save file as example.js

const carlo = require('carlo');

(async () => {
  const app = await carlo.launch();
  app.serveFolder(__dirname);
  await app.exposeFunction('env', _ => process.env);
  await app.load('example.html');
})();

Save file as example.html

<script>
async function run() {
  const data = await env();
  for (const type in data) {
    const div = document.createElement('div');
    div.textContent = `${type}: ${data[type]}`;
    document.body.appendChild(div);
  }
}
</script>
<body onload="run()">

Execute script on the command line

node example.js

Check out more examples with richer UI and RPC-based communication between the Web and Node componenets under the examples folder.

Contributing to Carlo

Check out contributing guide to get an overview of Puppeteer development.

FAQ

carlo's People

Contributors

joeleinbinder avatar pavelfeldman avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.