Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jakeburden/pull-nets

a pull-stream interface for the `require('nets')` npm module
https://github.com/jakeburden/pull-nets

Last synced: 17 days ago
JSON representation

a pull-stream interface for the `require('nets')` npm module

Awesome Lists containing this project

README

        

# pull-nets

A small pull-stream interface that makes the [nets](https://github.com/maxogden/nets) npm module into a source.
For making GET request in the browser or on the server.

## install

```
npm i pull-nets
```

## usage

```js
var nets = require('pull-nets')
var pull = require('pull-stream')

pull(
nets('https://scuttlebutt.nz'),
pull.drain(function (buf) {
console.log(buf.toString())
})
)
```

### note

the nature of `nets` is to return a buffer. so the source isn't really
streaming, it runs once and returns a buffer into memory.