join-params

Partial function application with parameter formatting

npm install join-params
1 downloads in the last week
5 downloads in the last month

join-params

Partial function application with parameter formatting.

$ npm install join-params

Usage


request    = require('request')
joinParams = require('join-params')

search = joinParams(request, 'https://www.google.com/search?q={1} site:{0}')

search('npmjs.org', 'partial application', function(error, response, body){

    body
    // => search results for "partial application site:npmjs.org"

})

Another example:


var log = joinParams(print, '[Log {0}]', 1) // "1"

log('info', 'hello', 'world')
// => [Log info] hello, world

function print(){
  process.stdout.write( Array.prototype.join.call(arguments, ', ') )
}

npm loves you