<commit_before>#!/usr/bin/env node

var minimist    = require('minimist'),
    flop        = require('..'),
    argv        = minimist(process.argv.slice(2));

(function(){
    'use strict';
    
    var path,
        keys    = Object.keys(argv);
    
    if (keys.length === 1)
        if (argv._.length)
            unknown();
        else
            help();
    else
        keys.some(function(name) {
            var isDone = true;
            
            if (name === 'h' || name === '')
                name = 'help';
            
            switch(name) {
            case 'help':
                help();
                break;
            
            case 'read':
                path = argv.read;
                break;
            
            case 'r':
                path = argv.r;
                break;
            
            case '_':
                isDone = false;
                break;
            
            default:
                isDone = true;
                unknown();
            }
            
            return isDone;
        });
    
    if (path) {
        flop.read(path, function(error, data) {
            if (error)
                console.log(error);
            else
                console.log(data);
        });
    }
    
    function help() {
        var message =   'flop - folder operations module.\n'        +
                        'options: \n'                               +
                        '-h, --help - show this message\n'          +
                        '-r, --read - get directory content\n';
        
        console.log(message);
    }
    
    function unknown() {
        var message =   'Unknown parameter. For help use: flop -h';
        
        console.log(message);
    }
    
})();
<commit_msg>chore(flop) rm iife<commit_after>#!/usr/bin/env node

'use strict';

var minimist = require('minimist');
var flop = require('..');
var argv = minimist(process.argv.slice(2));

var path;
var keys = Object.keys(argv);

if (keys.length === 1)
    if (argv._.length)
        unknown();
    else
        help();
else
    keys.some(function(name) {
        var isDone = true;
        
        if (name === 'h' || name === '')
            name = 'help';
        
        switch(name) {
        case 'help':
            help();
            break;
        
        case 'read':
            path = argv.read;
            break;
        
        case 'r':
            path = argv.r;
            break;
        
        case '_':
            isDone = false;
            break;
        
        default:
            isDone = true;
            unknown();
        }
        
        return isDone;
    });

if (path) {
    flop.read(path, function(error, data) {
        if (error)
            console.log(error);
        else
            console.log(data);
    });
}

function help() {
    var message =   'flop - folder operations module.\n'        +
                    'options: \n'                               +
                    '-h, --help - show this message\n'          +
                    '-r, --read - get directory content\n';
    
    console.log(message);
}

function unknown() {
    var message =   'Unknown parameter. For help use: flop -h';
    
    console.log(message);
}

{'fraction_non_alphanumeric': 0.12477007970570202, 'fraction_numerical': 0.001226241569589209, 'mean_word_length': 0.9811778992106861, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4169964', 'n_tokens_mistral': 912, 'n_tokens_neox': 888, 'n_words': 210}