<commit_before>node-htcondor contains various nodejs hooks for htcondor.

To install:

```bash
npm install htcondor
```

## Submit jobs

You can submit a condor job and watch for joblog.

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

//create condor submit object
var submit_options = {
    universe: "vanilla",
    executable: "test.sh",
    arguments: "hello",
    notification: "never",

    //transfer_output_files: 'bogus',

    shouldtransferfiles: "yes",
    when_to_transfer_output: "ON_EXIT",
    output: "stdout.txt",
    error: "stderr.txt",
    queue: 1
};

//submit to start the job
htcondor.submit(submit_options).then(function(job) {
    console.log("Submitted");

    //you can dump the condor submit property for your new job
    //console.dir(job.props);

    //job.id contains cluster/proc ids
    //console.dir(job.id);

    //you can *watch* job log
    job.log.watch(function(event) {
        switch(event.MyType) {

        //normal status type events (just display content)
        case "SubmitEvent":
        case "ExecuteEvent":
        case "JobImageSizeEvent":
            console.log(event.MyType);
            break;

        //critical events
        case "ShadowExceptionEvent":
            console.log(event.MyType);
            console.dir(event);

            //I now stop the watcher (ends this submission)
            job.log.unwatch();
            break;
<commit_msg>Use "onevent" instead of "watch" in the watch example in order to adhere to the JobLog interface.<commit_after>node-htcondor contains various nodejs hooks for htcondor.

To install:

```bash
npm install htcondor
```

## Submit jobs

You can submit a condor job and watch for joblog.

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

//create condor submit object
var submit_options = {
    universe: "vanilla",
    executable: "test.sh",
    arguments: "hello",
    notification: "never",

    //transfer_output_files: 'bogus',

    shouldtransferfiles: "yes",
    when_to_transfer_output: "ON_EXIT",
    output: "stdout.txt",
    error: "stderr.txt",
    queue: 1
};

//submit to start the job
htcondor.submit(submit_options).then(function(job) {
    console.log("Submitted");

    //you can dump the condor submit property for your new job
    //console.dir(job.props);

    //job.id contains cluster/proc ids
    //console.dir(job.id);

    //you can *watch* job log
    job.log.onevent(function(event) {
        switch(event.MyType) {

        //normal status type events (just display content)
        case "SubmitEvent":
        case "ExecuteEvent":
        case "JobImageSizeEvent":
            console.log(event.MyType);
            break;

        //critical events
        case "ShadowExceptionEvent":
            console.log(event.MyType);
            console.dir(event);

            //I now stop the watcher (ends this submission)
            job.log.unwatch();
            break;

{'fraction_non_alphanumeric': 0.11607761607761607, 'fraction_numerical': 0.000693000693000693, 'mean_word_length': 2.5641975308641975, 'pattern_counts': {'":': 8, '<': 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': '4163221', 'n_tokens_mistral': 885, 'n_tokens_neox': 855, 'n_words': 248}