Socket
Socket
Sign inDemoInstall

split2

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

split2 - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

8

package.json
{
"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 @@

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