1.0.0 • Published 6 years ago

es-tabify v1.0.0

Weekly downloads
131
License
MIT
Repository
github
Last release
6 years ago

es-tabify

A function that converts ElasticSearch results into a table data structure. The returned table data structure is similar to that returned by d3-dsv. Inspired by Kibana's tabify implementation. Works with hits style responses as well as nested aggregations.

See also this Python port of this library.

Usage

npm install es-tabify

Here's an example use with the official ElasticSearch JavaScript client.

var tabify = require('es-tabify');
var elasticsearch = require('elasticsearch');
var client = new elasticsearch.Client({
  host: 'localhost:9200',
  log: 'trace'
});

client.search({
  q: 'pants'
}).then(function (response) {
  var data = tabify(response);
}, function (error) {
  console.trace(error.message);
});

Options

Pass in configuration options via object key/value.

var options = { debug: true };
var data = tabify(response, options);
  • debug: (true | false:default) enable output debuging
1.0.0

6 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.1

7 years ago