<commit_before>/*
 * Copyright (c) 2013 <NAME>
 * Licensed under an MIT-style license (see LICENSE for full text)
 */
 /*global require:false, process:false */
(function () {
    'use strict';

    var JSONPathStream = require('../lib/jsonpathstream').JSONPathStream,
        parser = new JSONPathStream(process.argv[2]);

    process.stdin.pipe(parser);
    parser.pipe(process.stdout);

    process.stdin.resume();

}());<commit_msg>added capability for specifying a file to parse as an argument<commit_after>/*
 * Copyright (c) 2013 <NAME>
 * Licensed under an MIT-style license (see LICENSE for full text)
 */
 /*global require:false, process:false */
(function (path, fs) {
    'use strict';

    var JSONPathStream = require('../lib/jsonpathstream').JSONPathStream,
        parser = new JSONPathStream(process.argv[2]),
        filename = process.argv[3],
        readStream;

    parser.pipe(process.stdout);

    if (filename && filename !== '-') {
        readStream = fs.createReadStream(path.normalize(filename));
        readStream.on('data', function (data) {
            parser.write(data);
        });
        readStream.on('end', function () {
            parser.end();
        });
    } else {
        process.stdin.pipe(parser);
        process.stdin.resume();
    }

}(require('path'), require('fs')));
{'fraction_non_alphanumeric': 0.15442846328538987, 'fraction_numerical': 0.008327024981074944, 'mean_word_length': 2.96996996996997, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6150735', 'n_tokens_mistral': 392, 'n_tokens_neox': 378, 'n_words': 90}