bin/instagrab.js
function grabImages (opts) {
  if (!opts.quiet) console.log(multiline(function () {/*

 _ _|                  |                                    |
   |    __ \     __|   __|    _` |    _` |    __|    _` |   __ \
   |    |   |  \__ \   |     (   |   (   |   |      (   |   |   |
 ___|  _|  _|  ____/  \__|  \__,_|  \__, |  _|     \__,_|  _.__/
                                    |___/

*/}))

  opts.shortcode.forEach(function (shortcode) {
    // set up the sink
    var filename = instagrab.filename(shortcode, opts.size)
    var filepath = path.join(process.cwd(), filename)
    var toFile = fs.createWriteStream(filepath)
    toFile.on('error', onSaveError(shortcode))
    toFile.on('finish', function onSaved () {
      if (this.quiet) return;
      console.log('grabbed: ', filename)
    })

    // grab the bits
    return instagrab(shortcode, opts.size)
      .on('error', onGrabError(shortcode))
      .pipe(toFile)
  })
}
function grabImages (opts) {
  if (!opts.quiet) console.log(multiline(function () {/*

 _ _|                  |                                    |
   |    __ \     __|   __|    _` |    _` |    __|    _` |   __ \
   |    |   |  \__ \   |     (   |   (   |   |      (   |   |   |
 ___|  _|  _|  ____/  \__|  \__,_|  \__, |  _|     \__,_|  _.__/
                                    |___/

*/}))

  opts.shortcode.forEach(function (shortcode) {
    // set up the sink
    var filename = instagrab.filename(shortcode, opts.size)
    var filepath = path.join(process.cwd(), filename)
    var toFile = fs.createWriteStream(filepath)
    toFile.on('error', onSaveError(shortcode))
    toFile.on('finish', function onSaved () {
      if (this.quiet) return;
      console.log('grabbed: ', filename)
    })

    // grab the bits
    return instagrab(shortcode, opts.size)
      .on('error', onGrabError(shortcode))
      .pipe(toFile)
  })
}
function grabImages ( opts ) { if ( ! opts . quiet ) console . log ( multiline ( function ( ) { /*

 _ _|                  |                                    |
   |    __ \     __|   __|    _` |    _` |    __|    _` |   __ \
   |    |   |  \__ \   |     (   |   (   |   |      (   |   |   |
 ___|  _|  _|  ____/  \__|  \__,_|  \__, |  _|     \__,_|  _.__/
                                    |___/

*/ } ) ) opts . shortcode . forEach ( function ( shortcode ) { // set up the sink var filename = instagrab . filename ( shortcode , opts . size ) var filepath = path . join ( process . cwd ( ) , filename ) var toFile = fs . createWriteStream ( filepath ) toFile . on ( 'error' , onSaveError ( shortcode ) ) toFile . on ( 'finish' , function onSaved ( ) { if ( this . quiet ) return ; console . log ( 'grabbed: ' , filename ) } ) // grab the bits return instagrab ( shortcode , opts . size ) . on ( 'error' , onGrabError ( shortcode ) ) . pipe ( toFile ) } ) }
otherwise, start the fanfare and save the images
otherwise start the fanfare and save the images