'use strict';

var readFileList = require( './../lib' );

// Sync //

var files = readFileList.sync( [ __filename ], 'utf8' );
// returns <ObjectArray>

console.log( files instanceof Error );
// => false

files = readFileList.sync( [ 'beepboop' ], {
	'encoding': 'utf8'
});
// returns <Error>

console.log( files instanceof Error );
// => true


// Async //

readFileList( [ __filename ], onFiles );
readFileList( [ 'beepboop' ], onFiles );

function onFiles( error, files ) {
	if ( error ) {
		if ( error.code === 'ENOENT' ) {
			console.error( 'A file does not exist.' );
		} else {
			throw error;
		}
	} else {
		console.dir( files );
	}
}




'use strict';

var readFileList = require( './../lib' );

// Sync //

var files = readFileList.sync( [ __filename ], 'utf8' );
// returns <ObjectArray>

console.log( files instanceof Error );
// => false

files = readFileList.sync( [ 'beepboop' ], {
	'encoding': 'utf8'
});
// returns <Error>

console.log( files instanceof Error );
// => true


// Async //

readFileList( [ __filename ], onFiles );
readFileList( [ 'beepboop' ], onFiles );

function onFiles( error, files ) {
	if ( error ) {
		if ( error.code === 'ENOENT' ) {
			console.error( 'A file does not exist.' );
		} else {
			throw error;
		}
	} else {
		console.dir( files );
	}
}

Remove extra trailing empty lines
Remove extra trailing empty lines
