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

# emailer

Uses Gmail email and password to create a mail transporter.

**Parameters**

-   `senderEmail` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Your Gmail address.
-   `password` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Your Gmail password, or app password if you have 2FA enabled (<https://support.google.com/accounts/answer/185833>).

**Examples**

```javascript
const sendEmail = emailer('mario@toad.com', 'hunter2')

sendEmail('luigi@toad.com', 'Mario', 'RE: Koopas', 'Big Problem')
.fork( err, {..} )
```

Returns **[emailer.sendEmail](#emailersendemail)** 

# exec

Execute shell commands in the current working directory.

**Parameters**

-   `command` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The shell command to be executed.

**Examples**

```javascript
exec('pwd')
.fork( err, '/home/ronan/repos/rotools' )
```

Returns **any** Future&lt; err, string >

# futch

Futurized fetch. Worst name ever.

**Parameters**

-   `url` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** URL to fetch.
-   `options` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** fetch options to be passed in.

**Examples**

```javascript
futch('https://test.com/')
.fork( err, res )
```

Returns **any** Future&lt; err, object >

# futchJson

Futurized json fetch.

**Parameters**

-   `url` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** URL to fetch.
-   `options` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** fetch options to be passed in.

**Examples**

```javascript
futchJson('https://json.com/')
.fork( err, { yeah: 'ok' } )
```

Returns **any** Future&lt; err, any >

# getCurrentIp

Gets current IP address and validates it.

**Examples**

```javascript
getCurrentIp
.fork( err, '56.24.123.123' )
```

Returns **any** Future&lt; err, string >

# input

Get validated user input from the CLI.

**Parameters**

-   `validator` **[function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Input will be passed to this function and the Future will resolve with the value if it returns truthy.

**Examples**

```javascript
const isEven = x =>
Number(x) % 2 === 0

input( isEven )
.fork( err, '4' )
```

Returns **any** Future&lt; err, any >

# ipValidator

**Parameters**

-   `ip` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** IP address to validate.

**Examples**

```javascript
ipValidator('192.168.0.1') //=> true
```

Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 

# emailer.sendEmail

Returned from `emailer`. Sends an email.

**Parameters**

-   `recipient` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The email address of intended recipient.
-   `fromLabel` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The label to show in the inbox.
-   `subject` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Subject line text. (optional, default `''`)
-   `content` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Email body. (optional, default `''`)

**Examples**

```javascript
sendEmail('luigi@toad.com', 'Mario', 'RE: Koopas', 'Big Problem')
.fork( err, {..} )
```

Returns **any** Future&lt; err, object >

# fileMapper

Recursive filepath walker.

**Parameters**

-   `dir` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Directory to start from.

**Examples**

```javascript
fileMapper('/home/me') //=> ['/home/me/file.txt', '/home/me/folder/pic.png']
```

Returns **[array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** 

# flatten

Recursive array flattener.

**Parameters**

-   `arr` **[array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;any>** An array nested to any degree.

**Examples**

```javascript
flatten([1, [2, [3]]]) //=> [1, 2, 3]
```

Returns **[array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;any>** 

# json.read

Reads JSON files.

**Parameters**

-   `path` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Filepath.

**Examples**

```javascript
json.read('/file/path')
.fork( err, { yeah: 'ok' } )
```

Returns **any** Future&lt; err, any >

# json.write

Writes JSON files.

**Parameters**

-   `path` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Filepath.
-   `json` **any** Valid JSON.

**Examples**

```javascript
json.write('/file/path', { json: 'yeah' })
.fork( err, _ )
```

Returns **any** Future&lt; err, \_ >
