<commit_before># macrotasks

Tool for running external tools as simple javascript functions.

## Usage example #1

```
var macrotasks = require('macrotasks');

var ns = new macrotasks.Namespace();

ns.defineTask('pwd', {
    timeout: 10000,
    type: 'cmd',
    cmd: 'ls -alh',
    cwd: '..'
});

ns.runTask('pwd').then(function (res) {
    console.log('Success:', res);
}).catch(function (err) {
    console.log('Error:', err);<commit_msg>improve readme<commit_after># macrotasks

Tool for running external tools as simple javascript functions.

## Usage example #1

```
var macrotasks = require('macrotasks');

var ns = new macrotasks.Namespace();

ns.defineTask('myTaskName', {
    timeout: 10000, // timeout in milliseconds, default is 5 min (300000)
    type: 'cmd',    // execute shell commend on local machine
    cmd: 'ls -alh', // shell command
    cwd: '..'       // current working directory for executing command
});

ns.runTask('myTaskName').then(function (res) {
    console.log('Success:', res);
}).catch(function (err) {
    console.log('Error:', err);
{'fraction_non_alphanumeric': 0.1601123595505618, 'fraction_numerical': 0.017790262172284643, 'mean_word_length': 3.8812785388127855, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3968025', 'n_tokens_mistral': 373, 'n_tokens_neox': 336, 'n_words': 98}