modejs

1.0.0 • Public • Published

modejs is a library and cli for interacting with the modeanalytics.com api. Its not really documented, and might break. But this make it easier fetch data from mode and run more analysis locally.

  1. Get a token from https://modeanalytics.com/settings/access_tokens
  2. username is your mode username
  3. org is the mode org to use (defaults to username)
  4. token is the "password" that you get when creating a token on the access_tokens page... yeah its confusing.

Use as a library

// MODEJS_USERNAME  and MODEJS_TOKEN
var mode = require('modejs')({
    username: '',
    token: '',
    org: '' //optional
});


mode.reports(function(err, reports) {

  // list of reports

});

mode.report({id: '1oisdflsdf'}, function(err, report) {

  // details about a report

});

// gets data from the most recent run of the report
mode.reportData({reportId: '1oisdflsdf', org: 'myorg'}, function(err, data) {

    // data = JS array with an object per row.
});


// lists past runs of a report
mode.reportRuns({reportId: '1oisdflsdf'}, function(err, runs) {
    // list of runs of this report.
});

Use as a cli

npm install modejs -g

modejs data <org>/<reportid> // gets last report run. org is optional

modejs runs <org>/<reportid> // lists runs of a report org is optional

Readme

Keywords

Package Sidebar

Install

npm i modejs

Weekly Downloads

4

Version

1.0.0

License

ISC

Last publish

Collaborators

  • dthompson