Skip to content

zesty-io/node-chunk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-chunk

Chunks together a response stream.

Usage

Using the Node core http module we get a read stream which we can chunk the response and operate on the resulting string with our user defined callback.

  const chunk = require('./index')
  const http = require('http')

  let uri = 'http://fakeui.tumblr.com/api/read/json'
  let callback = (data) => {
    chunk(data, (result) => {
      // Operate on result string
      console.log(result)
    })
  }

  http.get(uri, callback)

About

Chunks togther a response stream

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages