/* eslint-disable no-sync */
'use strict';

// MODULES //

var fs = require( 'fs' );


// MAIN //

/**
* Synchronously reads the entire contents of a file.
*
* @param {(string|Buffer|integer)} file - file path or file descriptor
* @param {(Object|string)} [options] - options
* @returns {(Buffer|string|Error)} file contents or an error
*
* @example
* var out = readFileSync( __filename );
* if ( out instanceof Error ) {
*     throw out;
* }
* console.log( out );
*/
function readFileSync( file, options ) {
	var f;
	try {
		if ( arguments.length > 1 ) {
			f = fs.readFileSync( file, options );
		} else {
			f = fs.readFileSync( file );
		}
	} catch ( err ) {
		return err;
	}
	return f;
} // end FUNCTION readFileSync()


// EXPORTS //

module.exports = readFileSync;

'use strict';

// MODULES //

var fs = require( 'fs' );


// MAIN //

/**
* Synchronously reads the entire contents of a file.
*
* @param {(string|Buffer|integer)} file - file path or file descriptor
* @param {(Object|string)} [options] - options
* @returns {(Buffer|string|Error)} file contents or an error
*
* @example
* var out = readFileSync( __filename );
* if ( out instanceof Error ) {
*     throw out;
* }
* console.log( out );
*/
function readFileSync( file, options ) {
	var f;
	try {
		if ( arguments.length > 1 ) {
			f = fs.readFileSync( file, options ); // eslint-disable-line no-sync
		} else {
			f = fs.readFileSync( file ); // eslint-disable-line no-sync
		}
	} catch ( err ) {
		return err;
	}
	return f;
} // end FUNCTION readFileSync()


// EXPORTS //

module.exports = readFileSync;

Disable lint rule for specific lines
Disable lint rule for specific lines
