<commit_before># tasksf [![npm version](https://img.shields.io/npm/v/tasksf.svg?style=flat)](https://www.npmjs.com/package/tasksf) [![Build Status](https://img.shields.io/travis/ranapat/tasksf/master.svg?style=flat)](https://travis-ci.org/ranapat/tasksf) [![Coverage Status](https://coveralls.io/repos/ranapat/tasksf/badge.svg?branch=master)](https://coveralls.io/r/ranapat/tasksf?branch=master)
Simple tasks manager factory

### Run your code based on tasks

#### Install:

##### Install with npm
```bash
npm install tasksf
```

#### Use standalone
```html
<script src="https://cdn.jsdelivr.net/npm/tasksf/standalone/tasksf.js"></script>
or
<script src="https://cdn.jsdelivr.net/npm/tasksf/standalone/tasksf.min.js"></script>
```

#### Access the library:

##### Import
```javascript
import { tf } from 'tasksf';
```

##### Require
```javascript
const tasksf = require('tasksf');
```

##### Standalone
```html
<script src="https://cdn.jsdelivr.net/npm/tasksf/standalone/tasksf.min.js"></script>
<script>
// global tasksf variable exists
// tasksf.tf - factory
// tasksf.Task - task
// and so on
</script>
```

#### Examples:

##### Simple tasks in a sequence
```javascript
const task1 = tf.task(
  () => console.log('task 1 run'),
  () => console.log('task 1 complete')
);
const task2 = tf.task(
  () => console.log('task 2 run'),
  () => console.log('task 2 complete')
);

tf.sequence(() => console.log('sequence complete'))
  .push(task1)
  .push(task2)
  .run();

/**
 * Expected output:
 * task 1 run, task 1 complete,
 * task 2 run, task 2 complete,
 * sequence complete
 */
```

##### Simple tasks in a loop
```javascript
const task1 = tf.task(
  1,
  () => console.log('task 1 run'),
  () => console.log('task 1 complete')
);
const task2 = tf.task(
  () => console.log('task 2 run'),
  () => console.log('task 2 complete')
);

tf.loop(2, () => console.log('loop complete'))
  .push(task1)
  .push(task2)
  .run();

/**
 * Expected output:
 * task 1 run, task 1 complete,
 * task 2 run, task 2 complete,
 * task 1 run, task 1 complete,
 * task 2 run, task 2 complete,
 * loop complete
 */
```

##### Simple tasks in a parallel
```javascript
const task1 = tf.task(
  2,
  () => console.log('task 1 run'),
  () => console.log('task 1 complete')
);
const task2 = tf.task(
  1,
  () => console.log('task 2 run'),
  () => console.log('task 2 complete')
);

tf.parallel(() => console.log('parallel complete'))
  .push(task1)
  .push(task2)
  .run();

/**
 * Expected output:
 * task 2 run, task 2 complete,
 * task 1 run, task 1 complete,
 * parallel complete
 */
```

##### Simple tasks in a limiter
```javascript
const task1 = tf.task(
  2,
  () => console.log('task 1 run'),
  () => console.log('task 1 complete')
);
const task2 = tf.task(
  1,
  () => console.log('task 2 run'),
  () => console.log('task 2 complete')
);

tf.limiter(1, () => console.log('limiter complete'))
  .push(task1)
  .push(task2)
  .run();

/**
 * Expected output:
 * task 1 run, task 1 complete,
 * task 2 run, task 2 complete,
 * limiter complete
 */
```

#### More examples

[Check out use.tasksf](http://github.com/ranapat/use.tasksf)

#### Documentation

[Check the documentation md](http://github.com/ranapat/tasksf/blob/master/docs/docs.md)
[Check the documentation html](https://cdn.jsdelivr.net/npm/tasksf@latest/docs/index.html)

#### What is next

[Check the todo](http://github.com/ranapat/tasksf/blob/master/TODO.md)

#### What have changed

[Check the changelog](http://github.com/ranapat/tasksf/blob/master/CHANGELOG.md)<commit_msg>remove docs index html from readme<commit_after># tasksf [![npm version](https://img.shields.io/npm/v/tasksf.svg?style=flat)](https://www.npmjs.com/package/tasksf) [![Build Status](https://img.shields.io/travis/ranapat/tasksf/master.svg?style=flat)](https://travis-ci.org/ranapat/tasksf) [![Coverage Status](https://coveralls.io/repos/ranapat/tasksf/badge.svg?branch=master)](https://coveralls.io/r/ranapat/tasksf?branch=master)
Simple tasks manager factory

### Run your code based on tasks

#### Install:

##### Install with npm
```bash
npm install tasksf
```

#### Use standalone
```html
<script src="https://cdn.jsdelivr.net/npm/tasksf/standalone/tasksf.js"></script>
or
<script src="https://cdn.jsdelivr.net/npm/tasksf/standalone/tasksf.min.js"></script>
```

#### Access the library:

##### Import
```javascript
import { tf } from 'tasksf';
```

##### Require
```javascript
const tasksf = require('tasksf');
```

##### Standalone
```html
<script src="https://cdn.jsdelivr.net/npm/tasksf/standalone/tasksf.min.js"></script>
<script>
// global tasksf variable exists
// tasksf.tf - factory
// tasksf.Task - task
// and so on
</script>
```

#### Examples:

##### Simple tasks in a sequence
```javascript
const task1 = tf.task(
  () => console.log('task 1 run'),
  () => console.log('task 1 complete')
);
const task2 = tf.task(
  () => console.log('task 2 run'),
  () => console.log('task 2 complete')
);

tf.sequence(() => console.log('sequence complete'))
  .push(task1)
  .push(task2)
  .run();

/**
 * Expected output:
 * task 1 run, task 1 complete,
 * task 2 run, task 2 complete,
 * sequence complete
 */
```

##### Simple tasks in a loop
```javascript
const task1 = tf.task(
  1,
  () => console.log('task 1 run'),
  () => console.log('task 1 complete')
);
const task2 = tf.task(
  () => console.log('task 2 run'),
  () => console.log('task 2 complete')
);

tf.loop(2, () => console.log('loop complete'))
  .push(task1)
  .push(task2)
  .run();

/**
 * Expected output:
 * task 1 run, task 1 complete,
 * task 2 run, task 2 complete,
 * task 1 run, task 1 complete,
 * task 2 run, task 2 complete,
 * loop complete
 */
```

##### Simple tasks in a parallel
```javascript
const task1 = tf.task(
  2,
  () => console.log('task 1 run'),
  () => console.log('task 1 complete')
);
const task2 = tf.task(
  1,
  () => console.log('task 2 run'),
  () => console.log('task 2 complete')
);

tf.parallel(() => console.log('parallel complete'))
  .push(task1)
  .push(task2)
  .run();

/**
 * Expected output:
 * task 2 run, task 2 complete,
 * task 1 run, task 1 complete,
 * parallel complete
 */
```

##### Simple tasks in a limiter
```javascript
const task1 = tf.task(
  2,
  () => console.log('task 1 run'),
  () => console.log('task 1 complete')
);
const task2 = tf.task(
  1,
  () => console.log('task 2 run'),
  () => console.log('task 2 complete')
);

tf.limiter(1, () => console.log('limiter complete'))
  .push(task1)
  .push(task2)
  .run();

/**
 * Expected output:
 * task 1 run, task 1 complete,
 * task 2 run, task 2 complete,
 * limiter complete
 */
```

#### More examples

[Check out use.tasksf](http://github.com/ranapat/use.tasksf)

#### Documentation

[Check the documentation md](http://github.com/ranapat/tasksf/blob/master/docs/docs.md)

#### What is next

[Check the todo](http://github.com/ranapat/tasksf/blob/master/TODO.md)

#### What have changed

[Check the changelog](http://github.com/ranapat/tasksf/blob/master/CHANGELOG.md)
{'fraction_non_alphanumeric': 0.20489690721649484, 'fraction_numerical': 0.016895761741122565, 'mean_word_length': 3.957416607523066, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 59, 'https://': 19, 'lorem ipsum': 0, 'www.': 2, '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': '33765', 'n_tokens_mistral': 2589, 'n_tokens_neox': 2408, 'n_words': 586}