Socket
Socket
Sign inDemoInstall

bl

Package Overview
Dependencies
5
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

3

bl.js

@@ -5,2 +5,5 @@ const DuplexStream = require('readable-stream/duplex')

function BufferList (callback) {
if (!(this instanceof BufferList))
return new BufferList(callback)
if (typeof callback == 'function')

@@ -7,0 +10,0 @@ this._callback = callback

2

package.json
{
"name" : "bl"
, "version" : "0.1.0"
, "version" : "0.1.1"
, "description" : "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!"

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

@@ -41,7 +41,7 @@ # bl *(BufferList)*

```js
const BufferList = require('bl')
, fs = require('fs')
const bl = require('bl')
, fs = require('fs')
fs.createReadStream('README.md')
.pipe(new BufferList(function (err, data) {
.pipe(bl(function (err, data) { // note 'new' isn't strictly required
// `data` is just a reference to the BufferList

@@ -52,4 +52,15 @@ console.log(data.toString())

Or, use it as a readable stream:
Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) too):
```js
const hyperquest = require('hyperquest')
, bl = require('./')
, url = 'https://raw.github.com/rvagg/bl/master/README.md'
hyperquest(url).pipe(bl(function (err, data) {
console.log(data.toString())
}))
```
Or, use it as a readable stream to recompose a list of Buffers to an output source:
```js

@@ -87,2 +98,14 @@ const BufferList = require('bl')

`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:
```js
var bl = require('bl')
var myinstance = bl()
// equivilant to:
var BufferList = require('bl')
var myinstance = new BufferList()
```
--------------------------------------------------------

@@ -89,0 +112,0 @@ <a name="length"></a>

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc