<commit_before>#!/usr/bin/env node
'use strict';
const program = require('commander');
const fs = require('fs');
const listAndRun = require('./list-and-run');
const path = '/tmp/te';

program.parse(process.argv);

const line = program.args;
const file = fs.readFileSync(path, 'utf8');
fs.writeFileSync(path+'0', file);

var lines = [];
if (file.length) {
    var lines = file.split('\n');
}
lines.push(line);

fs.writeFileSync(path, lines.join('\n'));

listAndRun();<commit_msg>Change te-append to use appendFile instead of readFileSync/writeFileSync<commit_after>#!/usr/bin/env node
'use strict';
const program = require('commander');
const fs = require('fs');
const listAndRun = require('./list-and-run');
const path = '/tmp/te';

program.parse(process.argv);

const line = program.args;
const file = fs.readFileSync(path, 'utf8');
fs.writeFileSync(path+'0', file);

fs.appendFile(path, '\n'+line, (err) => {
    if (err) {
        console.log(err);
    }
    listAndRun();
});
{'fraction_non_alphanumeric': 0.1940755873340143, 'fraction_numerical': 0.0040858018386108275, 'mean_word_length': 4.764705882352941, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5848230', 'n_tokens_mistral': 338, 'n_tokens_neox': 339, 'n_words': 76}