lib/input-generators/textfile.js
function generateInput (options) {
  return nodeCall(
    fs.readFile,
    options.source
  )
    .catch(function (err) {
      options._abort(err);
    })
    .then(function (data) {
      var error;

      if (data) {
        data.toString().split('\n').every(function (line) {
          var page = line.replace(/^\s+|\s+$/g, "");

          if (!base.input(options, page)) {
            error = common.prependMsgToErr(base.generatorError(), page, true);
            return false;
          }
          return true;
        });

        if (error) {
          console.error(error);
          options._abort(error);
        }
      }

      base.EOI(textfile);
    });
}
function generateInput (options) {
  return nodeCall(
    fs.readFile,
    options.source
  )
    .catch(function (err) {
      options._abort(err);
    })
    .then(function (data) {
      var error;

      if (data) {
        data.toString().split('\n').every(function (line) {
          var page = line.replace(/^\s+|\s+$/g, "");

          if (!base.input(options, page)) {
            error = common.prependMsgToErr(base.generatorError(), page, true);
            return false;
          }
          return true;
        });

        if (error) {
          console.error(error);
          options._abort(error);
        }
      }

      base.EOI(textfile);
    });
}
function generateInput ( options ) { return nodeCall ( fs . readFile , options . source ) . catch ( function ( err ) { options . _abort ( err ) ; } ) . then ( function ( data ) { var error ; if ( data ) { data . toString ( ) . split ( '\n' ) . every ( function ( line ) { var page = line . replace ( / ^\s+|\s+$ / g , "" ) ; if ( ! base . input ( options , page ) ) { error = common . prependMsgToErr ( base . generatorError ( ) , page , true ) ; return false ; } return true ; } ) ; if ( error ) { console . error ( error ) ; options . _abort ( error ) ; } } base . EOI ( textfile ) ; } ) ; }
Generate the snapshot arguments from a line oriented text file.
Each line contains a single url we need a snapshot for.

@param {Object} options - input generator options object.
@param {String} options.source - path to the local input file.
@returns {Promise} resolves when complete.
Generate the snapshot arguments from a line oriented text file . Each line contains a single url we need a snapshot for .