<commit_before>Look sync. Do async.

## Info
Generators allows us to hide the **asynchronicity** as a implementation
detail and write synchronous-looking code. Example:

```js

```<commit_msg>exercises: async run<commit_after>Look sync. Do async.

## Info
Generators allows us to hide the **asynchronicity** as a implementation
detail and write synchronous-looking code. Example:

```js
var fs = require('fs');

function run (generator) {
  var it = generator(next);

  function next (err, result) {
    it.next(result);
  }

  next();  
}

run(function* (done) {
  var exercises = yield fs.readdir('exercises', done);
  console.log(exercises); // [ 'async_to_sync', ..., 'run_stop_run' ]
});

```
Here we read `exercises` directory to get list of directories inside,
`readdir` will not give us an immediate result, it requires callback
function as a second paramenter where where we can get the result.

But, we can improve it. Generators can **wait for readdir finishes** 

{'fraction_non_alphanumeric': 0.1158974358974359, 'fraction_numerical': 0.0, 'mean_word_length': 4.392265193370166, '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': '7039111', 'n_tokens_mistral': 305, 'n_tokens_neox': 291, 'n_words': 116}