READ SYNC // 
FUNCTION: readSync( path[, options] )
Reads the entire contents of a YAML file.

@param {String} path - file path
@param {Object|String} [options] - function options
@returns {Object|Error} JSON object or an error
169044
function readSync( path, options ) {
	var file,
		opts;

	if (
		arguments.length > 1 &&
		!isString( options )
	) {
		opts = options;
	} else {
		opts = {};
	}
	opts.encoding = 'utf8';
	file = readFile.sync( path, opts );
	if ( file instanceof Error ) {
		return file;
	}
	return parse( file, opts );
}
317774
function(path){
      var fullPath = []; 
      try{
        var files = fs.readdirSync(path); 
        for(var i = 0; i < files.length; i++){
          fullPath.push(path + '/' + files[i]); 
        }
        return fullPath; 
      }catch(e){
        return [];
      }
    }
1208297
function readJSON(filepath){
	var buffer = {};
	try{
		buffer = JSON.parse(fs.readFileSync(filepath, { encoding:'utf8' }));
	} catch(error){}
	return buffer;
}
122801
function readFile(path, callback) {
  nodeFs.readFile(path, function (err, binary) {
    if (err) {
      if (err.code === "ENOENT") return callback();
      return callback(err);
    }
    return callback(null, binary);
  });
}
722819
async function readComponentsMap(path) {
  return new Promise((resolve, reject) => {
    fs.readFile(path, (err, data) => {
      if (err) {
        return resolve({});
      }
      resolve(JSON.parse(data));
    });
  });
}
571496
function readLines(path, callback) {
    return new Promise(function(resolve, reject) {
        const stream = fsExtra.createReadStream(path);
        stream.on('error', reject);
        stream.on('end', resolve);

        const lineReader = readline.createInterface({
            input : stream
        });
        lineReader.on('line', callback);
    });
}
188835
def _read_file(path):
    '''
    
    '''
    try:
        with salt.utils.files.fopen(path, 'rb') as contents:
            return salt.utils.yaml.safe_load(contents)
    except (OSError, IOError):
        return {}
920358
async function readFile(path, encoding) {
	const url = browser.extension.getURL(realpath(path));

	return new Promise((resolve, reject) => {
		const xhr = new global.XMLHttpRequest;
		xhr.responseType = encoding == null ? 'arraybuffer' : 'text';
		xhr.addEventListener('load', () => resolve(xhr.response));
		xhr.addEventListener('error', reject);
		xhr.open('GET', url);
		xhr.send();
	});
}
538528
function _getFiles(path){
        let files = [];
        fs.readdirSync(path).forEach(function(file){
            let subpath = path + '/' + file;
            if(fs.lstatSync(subpath).isDirectory()){
                let filesReturned = _getFiles(subpath);
                files = files.concat(filesReturned);
            } else {
                files.push(path + '/' + file);
            }
        });
        return files;
    }
340373
function getJSON(filepath) {
  const jsonString = "g = " + fs.readFileSync(filepath, 'utf8') + "; g";
  return (new vm.Script(jsonString)).runInNewContext();
}
396488
function read(fp, opts, fn) {
  opts = opts || {};
  opts.encoding = opts.encoding || 'utf8';

  if (opts.read) {
    return opts.read(fp, opts);
  } else if (fn) {
    return fn(fp, opts);
  }

  if (endsWith(fp, '.js')) {
    return tryRequire(fp);
  } else {
    var str = tryCatch(fs.readFileSync, fp, opts);
    if (endsWith(fp, '.json')) {
      return tryCatch(JSON.parse, str);
    }
    return str;
  }
}
279859
function readFile(path) {
  if (!path) {
    throw new Error('The passed file must not be nil to be read.');
  }
  if (!FileUtils.doesFileExist(path)) {
    throw new Error(`The passed file '${path}' must exist and must not be a directory to be read.`);
  }
  return fs.readFileSync(path, 'utf-8').toString();
}
428744
function writeFileSync (filename, content, options) {
  if (typeof filename !== 'string') {
    throw new Error('path must be a string')
  }

  mkdirp.sync(path.dirname(filename))
  fs.writeFileSync(filename, content, options)
}
239964
function load(path) {
  return io.read(path).then(data => {
    let zip = new Zip;
    return zip.z_.loadAsync(data).then(() => zip);
  });
}
793021
function loadFromFile(path) {
    var data = fs.readFileSync(path, {encoding: "utf8"});
    _root = Repository.readObject(data);
    return _root;
}
1145352
function readFileSync (fileName, options) {
    verifyFileName (fileName);

    var info = getFileInfo (fileName);
    if (info.exists === false) {
        var message1 = format (cc.MSG_DOES_NOT_EXIST, fileName);
        throw new SafeFileError (cc.DOES_NOT_EXIST, message1);
    }
    if (info.isFile === false) {
        var message2 = format (cc.MSG_IS_NOT_A_FILE, fileName);
        throw new SafeFileError (cc.IS_NOT_A_FILE, message2);
    }

    // read data file
    var data = null;
    try {
        data = fs.readFileSync (fileName, options);
    } catch (e) {
        var message3 = format (cc.MSG_READ_ERROR, fileName, e.message);
        throw new SafeFileError (cc.READ_ERROR, message3);
    }

    // return data
    return (data);
}
668820
function readFiles (filepaths, callback) {
  async.map(filepaths, readFile.bind(this), function (err, files) {

    if (err) callback(err);

    callback(null, files);
  });
}