New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

filereader-stream

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filereader-stream - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

package.json
{
"name": "filereader-stream",
"version": "0.1.0",
"version": "0.1.1",
"description": "Read an HTML5 File object (from e.g. HTML5 drag and drops) as a stream.",

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

@@ -6,10 +6,40 @@ var test = require('tape');

test('should read file when one is dropped', function(t) {
drop(document.body, function(files) {
var first = files[0]
frs(first).pipe(concat(function(contents) {
t.true(contents.length > 0)
t.end()
drop(document.body, function(files) {
var first = files[0],
s = frs(first),
cursor, paused
test('should read file when one is dropped', function(t) {
s.pipe(concat(function(contents) {
t.true(contents.length > 0)
t.end()
}))
})
s.on('progress', function(offset){
if (offset / first.size < 0.5 || paused) return
test('should pause when over 30% of the file is read', function(t) {
cursor = s.pause()
t.true(cursor / first.size >= 0.5)
t.end()
})
test('should resume 2 seconds after pause', function(t) {
setTimeout(function(){
s.resume()
t.true(s.paused === false)
t.end()
}, 2000)
})
paused = true
})
s.on('end', function(offset){
test('should return correct offset upon end event', function(t) {
t.true(first.size === offset)
t.end()
})
})
})
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