code: function nameToImdb(args, cb) {
      args = typeof(args)=='string' ? { name: args } : args
  
      var q = { name: args.name }
      if (args.year) q.year = args.year
      if (args.type) q.type = args.type
  
      if (!q.name)
          return cb(new Error('empty name'))
  
      if (q.year && typeof(q.year)=='string') q.year = parseInt(q.year.split('-')[0])
      
      if (q.year && isNaN(q.year))
          return cb(new Error('invalid year'))
  
      if (q.type && !(q.type=='movie' || q.type=='series')) 
          return cb(null, null) // no match for other types
  
      var key = new Buffer(args.hintUrl || Object.values(q).join(':')).toString('ascii') // convert to ASCII since EventEmitter bugs with UTF8
      
      if (cache.hasOwnProperty(key) && Date.now()-cacheLastSet[key] < CACHE_TTL) {
          return cb(null, cache[key][0], { match: cache[key][1].match, isCached: true })
      }
  
      queue.push({ 
          id: key,
          q: q,
          providers: args.providers || defaultProviders,
      }, function(err, imdb_id, match) {
          if (err)
              return cb(err)
          
          if (imdb_id) {
              cache[key] = [imdb_id, match]
              cacheLastSet[key] = Date.now()
          }
  
          cb(null, imdb_id, match)
      })
  }
docs: Outside API