Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

juttle-client-library

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

juttle-client-library

Juttle Client Library is a set of frontend building blocks for creating applications that interact with outputs from [juttle](https://github.com/juttle/juttle) programs via [juttle-service](https://github.com/juttle/juttle-service).

  • 0.8.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
35
increased by1650%
Maintainers
2
Weekly downloads
 
Created
Source

Juttle Client Library

Juttle Client Library is a set of frontend building blocks for creating applications that interact with outputs from juttle programs via juttle-service.

Build Status

Introduction

Juttle Client Library consists of 5 distinct components: Views, Inputs, Errors, JobManager, and HttpApi.

ComponentDescription
ViewsThe Views class is used to run a bundle (a juttle program with its modules) against an instance of Juttle Service and render its output onto a provided DOM node.
InputsGiven a bundle, an inputs instance will render the bundle's inputs to specified DOM node.
ErrorsGiven an error object returned from either juttle-service or juttle-viz, an Errors instance will render a user-friendly error message.
JobManagerInteracts with the Juttle Service api to run and manage the lifecycle of a running Juttle Program. Emits events received from the Juttle Service streaming api.
HttpApiClient functions for interacting with the Juttle Service http api.

Additionally Juttle Client Library also exports these enums:

EnumDescription
JobStatusAn enum used to described the status of a given JobManager instance. Returned from the getStatus() method of JobManager. Possible values can be STOPPED, STARTING, RUNNING
ViewStatusExactly the same as JobStatus only returned from the getStatus() of a Views instance.

Getting Started

npm install --save juttle-client-library

A quick example:

import { Views, Inputs } from 'juttle-client-library';

let views = new Views(JUTTLE_SERVICE_HOST, document.getElementById('views'));
let inputs = new Inputs(JUTTLE_SERVICE_HOST, document.getElementById('inputs'));

let bundle = {
    program: 'input person:text; emit | put greeting = "hello " + person'    
};


inputs.render(bundle);

document.getElementById('btn-run').addEventListener('click', () => {
    inputs.getValues()
    .then(values => views.run(bundle, values));
});

API

See the example and test directory for how this library should be used. A more complete implementation can be see in juttle/juttle-viewer

Running Example

Prerequisite - Have a locally running instance of Juttle Service (or Juttle Engine) on port 8080 (you can adjust the location by changing line 6 of example/index.js).

Here's how to run this library locally from this repo (also used for development purposes):

$ git clone https://github.com/juttle/juttle-client-library.git
$ cd juttle-client-library
$ npm install
$ cd example
$ ./server.js

FAQs

Package last updated on 24 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc