Skip to content

node.js module that collects remote data from different sources and passes it into callback

Notifications You must be signed in to change notification settings

zlibra/get-bunch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

get-bunch

get-bunch collects remote data from different sources and passes it into callback.

Installation

npm install get-bunch

Example

var getBunch = require( 'get-bunch' );

getBunch.getMulti([
    { name: 'name1', url: url1 },
    // type 'plain' means it will not be parsed as JSON
    { name: 'name2', url: url2, type: 'plain' }
], function( results ) {

    console.log( results.name1 );   // parsed JSON from url1
    console.log( results.name2 );   // plain HTML from url2

})

Methods

get( obj )

Get data from one source.

param: {Object}

{
    name: 'name1',  // property name that will contain data
    url: url1,      // URL
    type: 'plain'   // optional, 'plain' will not be JSON parsed
}

getMulti( Array, callback )

Gets data from many sources (Array of objects described in get) and passes it in one object into callback.

About

node.js module that collects remote data from different sources and passes it into callback

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published