<commit_before>'use strict';

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

// Sync//

var out = readDir.sync( __dirname );
// returns <Array>

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

out = readDir.sync( 'beepboop' );
// returns <Error>

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


// Async //

readDir( __dirname, onRead );
readDir( 'beepboop', onRead );

function onRead( error, data ) {
	if ( error ) {
		if ( error.code === 'ENOENT' ) {
			console.error( 'Directory does not exist.' );
		} else {
			throw error;
		}
	} else {
		console.log( data );
	}
}



<commit_msg>Remove extra trailing lines<commit_after>'use strict';

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

// Sync//

var out = readDir.sync( __dirname );
// returns <Array>

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

out = readDir.sync( 'beepboop' );
// returns <Error>

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


// Async //

readDir( __dirname, onRead );
readDir( 'beepboop', onRead );

function onRead( error, data ) {
	if ( error ) {
		if ( error.code === 'ENOENT' ) {
			console.error( 'Directory does not exist.' );
		} else {
			throw error;
		}
	} else {
		console.log( data );
	}
}

{'fraction_non_alphanumeric': 0.1804255319148936, 'fraction_numerical': 0.0, 'mean_word_length': 2.881188118811881, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4736040', 'n_tokens_mistral': 435, 'n_tokens_neox': 414, 'n_words': 113}