synchronously run a process in nodejs

I tried to hit 2 web-services and got their response. The web-services should be hit in parallel instead Node.js does that asynchronously. The childprocess.spawn also behaves asynchronously. Any idea as how to hit the two web-services in parallel from the same Node.js code will be really helpful.

Like robertklep suggested async is the way to go

Parallel Web Requests

/**
* Fetches both goole and yahoo at the same time, but waits until both 
* are done before returning
**/
var async = require('async')
var request = require('request')
var inspect = require('eyespect').inspector()
doParallel(function (err) {
  if (err) {
    inspect(err, 'error running parallel tasks')
  }
  inspect('********************************************************************')
  inspect('done with parallel tasks')
})
function doParallel(callback) {
  async.parallel([
    // fetch google.com
    function (cb) {
      var url = 'http://www.google.com'
      request(url, function (err, res, body) {
        if (err) {
          return cb({
            message: 'error getting google.com',
            url: url,
            error: err
          })
        }
        inspect(res.statusCode, 'google response status code')
        inspect(body, 'google response body')
        cb()
      })
    },

    function (cb) {
      var url = 'http://www.yahoo.com'
      request(url, function (err, res, body) {
        if (err) {
          return cb({
            message: 'error getting google.com',
            url: url,
            error: err
          })
        }
        inspect(res.statusCode, 'yahoo response status code')
        inspect(body, 'yahoo response body')
        cb()
      })
    }
  ], callback)
}

Series Web Requests

var async = require('async')
var request = require('request')
var inspect = require('eyespect').inspector()
doSeries(function (err) {
  if (err) {
    inspect(err, 'error running parallel tasks')
  }
  inspect('********************************************************************')
  inspect('done with parallel tasks')
})
/**
 * Fetch google first, wait for it to finish, and then fetch yahoo
 **/
function doSeries(callback) {
  async.series([
    // fetch google.com
    function (cb) {
      var url = 'http://www.google.com'
      request(url, function (err, res, body) {
        if (err) {
          return cb({
            message: 'error getting google.com',
            url: url,
            error: err
          })
        }
        inspect(res.statusCode, 'google response status code')
        inspect(body, 'google response body')
        cb()
      })
    },

    function (cb) {
      var url = 'http://www.yahoo.com'
      request(url, function (err, res, body) {
        if (err) {
          return cb({
            message: 'error getting google.com',
            url: url,
            error: err
          })
        }
        inspect(res.statusCode, 'yahoo response status code')
        inspect(body, 'yahoo response body')
        cb()
      })
    }
  ], callback)
}