code: function screenshot(options, config, onFinish) {
      const conf = createConfig(options, config),
            opts = createOptions(options, config),
            base64 = utils.encodeBase64(opts),
            file = outputFile(opts, conf),
  
            retrieveImageFromStorage = () => {
                logger.debug('Take screenshot from file storage: %s', base64);
                onFinish(file);
            },
            retrieveImageFromSite = () => {
                runCapturingProcess(opts, conf, file, base64, (error) => {
                    logger.debug('Process finished work: %s', base64);
                    return onFinish(file, error);
                });
            };
  
      logger.info('Capture site screenshot: "%s"', options.url);
  
      if (options.force || !conf.cache) {
          retrieveImageFromSite();
      } else {
          fs.exists(file, (exists) =>
              exists ? retrieveImageFromStorage() : retrieveImageFromSite());
      }
  }
docs: /* External API