precog

0.1.3 • Public • Published

Precog Client for JavaScript

Precog is a powerful analytics platform for JSON data. This JavaScript client allows easy streaming, uploading, and querying of data.

Installation

Browser

Include precog.min.js to get a global Precog object:

<script src="precog.min.js"></script>

node.js

Install the precog library:

npm install precog

And load the library:

var precog = require('precog');

Getting Started

  1. Create a new Precog API by specifying your API key.

    var api = new Precog.api({"apiKey": "[MY API KEY]", "analyticsService" : "https://beta.precog.com"});
    
  2. Upload or stream some JSON data into a subdirectory of your base path. Your base path starts with your Precog account ID.

    api.append({path: '/[MY ACCOUNT ID]/test', value: {age: 29, gender: 'male'}});
    
  3. Query your JSON data.

    api.execute({query: 'count(//[MY ACCOUNT ID]/test)'});
    

Documentation

Visit the Precog Developer Center for documentation on the REST API and client libraries.

Development

If you would like to made modifications to the source, you can build a distribution by running the following from the project directory:

npm install

Tests can be run from npm:

npm test

Or by loading test-api.htm under the test directory into a browser.

Readme

Keywords

none

Package Sidebar

Install

npm i precog

Weekly Downloads

4

Version

0.1.3

License

none

Last publish

Collaborators

  • puffnfresh
  • jdegoes