> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectdiscovery.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Redis

# Namespace: redis

## Table of contents

### Functions

* [Connect](/templates/protocols/javascript/modules/redis#connect)
* [GetServerInfo](/templates/protocols/javascript/modules/redis#getserverinfo)
* [GetServerInfoAuth](/templates/protocols/javascript/modules/redis#getserverinfoauth)
* [IsAuthenticated](/templates/protocols/javascript/modules/redis#isauthenticated)
* [RunLuaScript](/templates/protocols/javascript/modules/redis#runluascript)

## Functions

### Connect

▸ **Connect**(`host`, `port`, `password`): `boolean` | `null`

Connect tries to connect redis server with password

#### Parameters

| Name       | Type     |
| :--------- | :------- |
| `host`     | `string` |
| `port`     | `number` |
| `password` | `string` |

#### Returns

`boolean` | `null`

**`Example`**

```javascript theme={null}
const redis = require('nuclei/redis');
const connected = redis.Connect('acme.com', 6379, 'password');
```

#### Defined in

redis.ts:11

***

### GetServerInfo

▸ **GetServerInfo**(`host`, `port`): `string` | `null`

GetServerInfo returns the server info for a redis server

#### Parameters

| Name   | Type     |
| :----- | :------- |
| `host` | `string` |
| `port` | `number` |

#### Returns

`string` | `null`

**`Example`**

```javascript theme={null}
const redis = require('nuclei/redis');
const info = redis.GetServerInfo('acme.com', 6379);
```

#### Defined in

redis.ts:25

***

### GetServerInfoAuth

▸ **GetServerInfoAuth**(`host`, `port`, `password`): `string` | `null`

GetServerInfoAuth returns the server info for a redis server

#### Parameters

| Name       | Type     |
| :--------- | :------- |
| `host`     | `string` |
| `port`     | `number` |
| `password` | `string` |

#### Returns

`string` | `null`

**`Example`**

```javascript theme={null}
const redis = require('nuclei/redis');
const info = redis.GetServerInfoAuth('acme.com', 6379, 'password');
```

#### Defined in

redis.ts:39

***

### IsAuthenticated

▸ **IsAuthenticated**(`host`, `port`): `boolean` | `null`

IsAuthenticated checks if the redis server requires authentication

#### Parameters

| Name   | Type     |
| :----- | :------- |
| `host` | `string` |
| `port` | `number` |

#### Returns

`boolean` | `null`

**`Example`**

```javascript theme={null}
const redis = require('nuclei/redis');
const isAuthenticated = redis.IsAuthenticated('acme.com', 6379);
```

#### Defined in

redis.ts:53

***

### RunLuaScript

▸ **RunLuaScript**(`host`, `port`, `password`, `script`): `any` | `null`

RunLuaScript runs a lua script on the redis server

#### Parameters

| Name       | Type     |
| :--------- | :------- |
| `host`     | `string` |
| `port`     | `number` |
| `password` | `string` |
| `script`   | `string` |

#### Returns

`any` | `null`

**`Example`**

```javascript theme={null}
const redis = require('nuclei/redis');
const result = redis.RunLuaScript('acme.com', 6379, 'password', 'return redis.call("get", KEYS[1])');
```

#### Defined in

redis.ts:67
