Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

render-data

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

render-data - npm Package Compare versions

Comparing version 1.1.2 to 2.0.0

22

index.js

@@ -7,2 +7,9 @@ var path = require('path')

var exts = {
'.csv': 'csv',
'.tsv': 'csv',
'.json': 'raw',
'.tex': 'raw'
}
module.exports = { render: render, append: append }

@@ -21,12 +28,13 @@

var extname = path.extname(file.name).toLowerCase()
if (extname === '.csv') {
var filetype = exts[path.extname(file.name).toLowerCase()]
if (filetype === 'csv') {
appendCSV(file, el, function (err, elem) {
if (err) return handleError(file, el, cb)
if (err) return cb(err)
return cb(null, elem)
})
}
else {
} else if (filetype === 'raw') {
raw(file, el, cb)
} else {
media.append(file, el, function (err, elem) {
if (err) return handleError(file, el, cb)
if (err) return cb(err)
return cb(null, elem)

@@ -46,3 +54,3 @@ })

function handleError (file, el, cb) {
function raw (file, el, cb) {
var elem = document.createElement('iframe')

@@ -49,0 +57,0 @@ streamToBlobURL(file.createReadStream(), function (err, url) {

{
"name": "render-data",
"version": "1.1.2",
"version": "2.0.0",
"description": "Automagically render data files in the browser, like render-media",

@@ -5,0 +5,0 @@ "main": "index.js",

# 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](http://npmjs.com/package/render-media)). It will also attempt to display complicated filetypes intelligently, like .csv or shapefiles (coming soon).
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](http://npmjs.com/package/render-media)).
It will attempt to display filetypes intelligently, like .csv and .json.
### install

@@ -7,0 +9,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc