<commit_before>const http = require('http');
const jobs = require('./jobs')

http.createServer(function (req, result) {
    result.writeHead(200, {'Content-Type': 'text/plain'});
    jobs.jobs('jobs').then((jobslist) => {
    	result.end(jobslist);
    }).catch((error) => {
    	result.end('No jobs found in ./jobs directory')
    });
}).listen(8080);<commit_msg>List the jobs in jobs folder<commit_after>const http = require('http');
const fs = require('fs');
const util = require('util');


http.createServer(function (req, result) {
    result.writeHead(200, {'Content-Type': 'text/plain'});
    
    const readdir = util.promisify(fs.readdir);

    readdir("jobs").then((jobslist) => {
    	result.end(jobslist.join(','));
    }).catch((error) => {
    	console.log('Error reading directory', error)
    	result.end('No jobs found in ./jobs directory')
    });
}).listen(8080);
{'fraction_non_alphanumeric': 0.19954648526077098, 'fraction_numerical': 0.015873015873015872, 'mean_word_length': 4.045714285714285, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1281244', 'n_tokens_mistral': 303, 'n_tokens_neox': 282, 'n_words': 58}