Comparing version 0.1.2 to 0.2.0
{ | ||
"name": "split2", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "split a Text Stream into a Line Stream, using Stream 2", | ||
@@ -23,9 +23,9 @@ "main": "index.js", | ||
"devDependencies": { | ||
"tap": "~0.4.8", | ||
"pre-commit": "0.0.4", | ||
"tap": "~0.4.12", | ||
"pre-commit": "0.0.9", | ||
"callback-stream": "~1.0.2" | ||
}, | ||
"dependencies": { | ||
"through2": "~0.4.1" | ||
"through2": "~0.6.0" | ||
} | ||
} |
@@ -29,2 +29,21 @@ # Split2(matcher, mapper, options) | ||
Calling `.destroy` will make the stream emit `close`. Use this to perform cleanup logic | ||
``` js | ||
var splitFile = function(filename) { | ||
var file = fs.createReadStream(filename) | ||
return file | ||
.pipe(split2()) | ||
.on('close', function() { | ||
// destroy the file stream in case the split stream was destroyed | ||
file.destroy() | ||
}) | ||
} | ||
var stream = splitFile('my-file.txt') | ||
stream.destroy() // will destroy the input file stream | ||
``` | ||
# NDJ - Newline Delimited Json | ||
@@ -31,0 +50,0 @@ |
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
254002
75
+ Addedthrough2@0.6.5(transitive)
+ Addedxtend@4.0.2(transitive)
- Removedobject-keys@0.4.0(transitive)
- Removedthrough2@0.4.2(transitive)
- Removedxtend@2.1.2(transitive)
Updatedthrough2@~0.6.0