<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

-   [run][1]
    -   [Parameters][2]
    -   [Examples][3]
-   [readIn][4]
    -   [Parameters][5]
    -   [Examples][6]
-   [readFiles][7]
    -   [Parameters][8]
    -   [Examples][9]

## run

Start the hasher.

### Parameters

-   `files` **[Array][10]&lt;[string][11]>** List of files to go through (optional, default `[]`)
-   `obj` **[Object][12]** Configuration (optional, default `{}`)
    -   `obj.format` **[string][11]** Format of the output (text, json, csv) (optional, default `'text'`)
    -   `obj.input` **[string][11]** Location of the input (any, stdin, args) (optional, default `'any'`)
    -   `obj.output` **[string][11]** Destination for the output (stdout, var, <i>filenames</i>) (optional, default `'stdout'`)
    -   `obj.prettify` **[boolean][13]** Prettify the output (optional, default `false`)

### Examples

Reading from files or STDIN


```javascript
run();
```

Reading from files


```javascript
run(['index.js']);
run(['index.js'], {input: 'args'});
```

Reading from STDIN


```javascript
run([]);
run([], {input: 'stdin'});
```

Reading from files with configurations


```javascript
run(['index.js', 'index.css'], {format: 'json', output: 'index-hash.json', prettify: true});
```

Reading from STDIN with configurations


```javascript
run([], {format: 'csv', input: 'stdin', prettify: true});
```

Returns **([undefined][14] \| [Array][10]&lt;[string][11]> | [string][11])** Data or nothing

## readIn

-   **See: Config**

Read user's input from STDIN.

### Parameters

-   `obj` **Config** Configuration (optional, default `{}`)
    -   `obj.prettify`   (optional, default `false`)
    -   `obj.outputDest`   (optional, default `OUTPUT_DEST`)
    -   `obj.outputFormat`   (optional, default `OUTPUT_FORMAT`)

### Examples

```javascript
readIn();
```

With configurations


```javascript
readIn({outputFormat: 'json'});
readIn({prettify: true, outputDest: 'outputFromSTDIN.txt'});
```

Returns **([undefined][14] \| [string][11])** Data or nothing

## readFiles

-   **See: Config**

Read files and scan them.

### Parameters

-   `files` **[Array][10]&lt;[string][11]>?** Array of file paths (optional, default `process.argv.slice(2,process.argv.length)`)
-   `obj` **Config** Configuration (optional, default `{}`)
    -   `obj.prettify`   (optional, default `false`)
    -   `obj.outputDest`   (optional, default `OUTPUT_DEST`)
    -   `obj.outputFormat`   (optional, default `OUTPUT_FORMAT`)

### Examples

Reading from the CLI


```javascript
readFiles();
```

Reading from specific files


```javascript
readFiles(['output.txt']);
```

... With specific configurations


```javascript
readFiles(['input.json'], {prettify: true, outputFormat: 'json'}); //logs {<br>  "output.json": "sha256-iTyF6rE+vAUIIWrWaC6bWt9NwI/74kpOuk4JZl9zCMM="<br>}
readFiles(['input.csv'], {outputDest: 'output.json', outputFormat: 'json'}); //Writes the above to output.json
```

[1]: #run

[2]: #parameters

[3]: #examples

[4]: #readin

[5]: #parameters-1

[6]: #examples-1

[7]: #readfiles

[8]: #parameters-2

[9]: #examples-2

[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array

[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean

[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined
