render-data
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -42,5 +42,2 @@ var path = require('path') | ||
} | ||
if (typeof file.createReadStream !== 'function') { | ||
throw new Error('missing or invalid file.createReadStream property') | ||
} | ||
} | ||
@@ -47,0 +44,0 @@ |
@@ -1,5 +0,5 @@ | ||
// TODO: don't forget callback! | ||
var csv = require('csv-parser') | ||
module.exports = function (file, el, cb) { | ||
if (!el) return callbackOnce(new Error ('el is undefined')) | ||
@@ -38,2 +38,3 @@ var t = document.createElement('table') | ||
parser.pause() | ||
callbackOnce(null, t) | ||
} | ||
@@ -43,5 +44,15 @@ }) | ||
parser.on('end', function () { | ||
if (inc >= incrBy) el.removeChild(more) | ||
if (inc >= incrBy) { | ||
el.removeChild(more) | ||
} | ||
else { | ||
callbackOnce(null, t) | ||
} | ||
}) | ||
function callbackOnce (err, elem) { | ||
cb(err, elem) | ||
cb = function () {} | ||
} | ||
} |
{ | ||
"name": "render-data", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Automagically render data files in the browser, like render-media", | ||
@@ -22,4 +22,4 @@ "main": "index.js", | ||
"render-media": "^2.0.2", | ||
"stream-to-blob-url": "^1.0.0" | ||
"stream-to-blob-url": "^2.0.0" | ||
} | ||
} |
@@ -18,3 +18,5 @@ # render-data | ||
name: 'stuff.R', | ||
createReadStream: fs.createReadStream('/path/to/my/data/and/stuff') | ||
createReadStream: function () { | ||
return fs.createReadStream('/path/to/my/data/and/stuff') | ||
} | ||
} | ||
@@ -21,0 +23,0 @@ data.render(file, elem, function (err) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4153
96
30
- Removedstream-to-blob-url@1.0.0(transitive)
- Removedstream-with-known-length-to-buffer@1.0.4(transitive)
Updatedstream-to-blob-url@^2.0.0