okdistribute / render-data

Intelligently render a data stream in a browser.
15 stars 6 forks source link

render-data

Show a data stream in a browser. This automatically detects the extension, and displays the data intelligently, supporting video, audio, and images (thanks to render-media).

It will attempt to display filetypes intelligently, like .csv, .json, and .geojson!

install

npm install render-data

usage

var data = require('render-data')
var file = {
  name: 'stuff.R',
  createReadStream: function () {
    return fs.createReadStream('/path/to/my/data/and/stuff')
  }
}
data.render(file, elem, opts, function (err) {
  console.log('done rendering')
})

example

Example in yo-fs.