<commit_before># uni tools

## CHAIN

Chains are Uni's way of handling asynchronous functions. They are much more composable and simple to understand than promises.

```javascript

var ary = [1,2,3];
uni.ch(function(d,ch){
	console.log('1');
	ch.pass();
}).ch(function(d,ch){
	console.log('2');
}).fail(function(d,ch){
	console.log('failed');
});

```

## LOOP

Loops are used to handle asynchronous repeating functions. Loops are used when a standard loop operator like "for" will not work.

```javascript

var ary = [1,2,3];
uni.loop(ary,function(loop){
	console.log('loop ',ary[loop.i]);
	loop.pass();
});

```<commit_msg>major library and documentation updates - getting closer to a stable alpha<commit_after># uni tools

## CHAIN

Chains are Uni's way of handling asynchronous functions. They are much more composable and simple to understand than promises.

```javascript

uni.ch(function(d,ch){
	console.log('first');
	ch.pass('first is done');
}).ch(function(d,ch){
	console.log(d,' now on second');
	ch.fail('testing a fail');
}).fail(function(d,ch){
	console.log('failed:',d);
});

```

## LOOP

Loops are used to handle asynchronous repeating functions. Loops are used when a standard loop operator like "for" will not work.

```javascript

var ary = [1,2,3];
uni.loop(ary,function(loop){
	console.log('loop ',ary[loop.i]);
	loop.pass();
});

```
{'fraction_non_alphanumeric': 0.16507000736919675, 'fraction_numerical': 0.008106116433308769, 'mean_word_length': 5.089686098654709, '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': '1144534', 'n_tokens_mistral': 469, 'n_tokens_neox': 444, 'n_words': 143}