npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

juttle-client-library

v0.8.0

Published

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).

Downloads

41

Readme

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.

| Component | Description | | --------- | ----------- | | Views | The 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. | | Inputs | Given a bundle, an inputs instance will render the bundle's inputs to specified DOM node. | | Errors | Given an error object returned from either juttle-service or juttle-viz, an Errors instance will render a user-friendly error message. | | JobManager | Interacts 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. | | HttpApi | Client functions for interacting with the Juttle Service http api. |

Additionally Juttle Client Library also exports these enums:

| Enum | Description | | --------- | ----------- | | JobStatus | An 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 | | ViewStatus | Exactly 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