Stream objects to a table
CoffeeScript JavaScript HTML CSS
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
lib
test
.gitignore
README.md
index.js
package.json

README.md

Hypnotable

Easily create a table from a stream (or array) of objects.

browser support

Example

var Hypnotable = require('hypnotable');

var hyperquest = require('hyperquest');
var JSONStream = require('JSONStream');
var accounting = require('accounting');

columns = [
  {
    property: 'screenName',
    title: 'Screen Name'
  }, {
    property: 'followers',
    title: 'Follower Count',
    template: accounting.formatNumber
  }
];

var stream = hyperquest('/api/accounts.json');
var parser = JSONStream.parse([true]);
stream.pipe(parser);

var ht = Hypnotable(columns);
document.body.appendChild(ht.el);

parser.pipe(ht);

To see a bit more look at /example/basic.js or locally run:

npm run-script example

License

MIT

hypnotoad