open-index/open-npm huggingface dataset:
npm package: @keyue/ssh-mcp-server
Description: SSH MCP Server for remote server management - 让Claude Code能够直接管理远程服务器
Author: keyue
Latest version: 1.0.0

# SSH MCP Server

一个强大的SSH MCP (Model Context Protocol) 服务器，让Claude Code能够直接管理远程服务器。

## ✨ 功能特性

- **🔌 连接管理**: 建立和管理多个SSH连接
- **⚡ 命令执行**: 在远程服务器上执行任意命令
- **📁 文件操作**: 上传、下载、删除文件
- **📂 目录管理**: 列出目录内容、创建目录
- **🔐 安全认证**: 支持密码和私钥认证
- **🚀 即用即走**: 通过npx直接使用，无需安装

## 🛠️ 安装和使用

### 方式一：npx直接使用（推荐）

```bash
npx @keyue/ssh-mcp-server
```

### 方式二：配置到Claude Code

在你的Claude Code配置文件中添加：

```json
{
  "mcpServers": {
    "ssh": {
      "command": "npx",
      "args": ["@keyue/ssh-mcp-server"]
    }
  }
}
```

配置文件位置：
- macOS/Linux: `~/.config/claude/claude_desktop_config.json`
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`

### 方式三：从源码构建

```bash
# 克隆仓库（码云）
git clone https://gitee.com/[你的码云用户名]/ssh-mcp-server.git
cd ssh-mcp-server

# 安装依赖
npm install

# 构建项目
npm run build

# 启动服务器
npm start
```

## 📋 可用工具

### 连接管理
- `ssh_connect`: 建立SSH连接到远程服务器
- `ssh_list_connections`: 列出所有活跃的SSH连接
- `ssh_disconnect`: 断开SSH连接

### 命令执行
- `ssh_exec`: 在远程服务器上执行命令

### 文件操作
- `ssh_upload_file`: 上传文件到远程服务器
- `ssh_download_file`: 从远程服务器下载文件
- `ssh_delete_file`: 删除远程文件

### 目录管理
- `ssh_list_files`: 列出远程目录内容
- `ssh_create_directory`: 创建远程目录

## 💡 使用示例

### 1. 建立SSH连接

在Claude Code中使用 `ssh_connect` 工具：
- **host**: 服务器地址 (如：192.168.1.100)
- **username**: 用户名 (如：root)
- **password**: 密码 (可选)
- **privateKey**: 私钥内容 (可选)
- **port**: SSH端口 (默认22)

### 2. 执行远程命令

使用 `ssh_exec` 工具：
- **connectionId**: 连接ID
- **command**: 要执行的命令 (如：`ls -la`)

### 3. 文件上传

使用 `ssh_upload_file` 工具：
- **connectionId**: 连接ID
- **localPath**: 本地文件路径
- **remotePath**: 远程文件路径

## 🔒 安全说明

- 支持密码和私钥认证
- 私钥密码短语保护
- 连接状态管理
- 错误处理和异常管理
- 建议使用密钥认证而非密码认证

## ⚠️ 注意事项

- 确保服务器SSH服务已启动
- 检查防火墙设置
- 妥善保管认证信息
- 建议在受信任的网络环境中使用

## 🤝 贡献

欢迎提交Issue和Pull Request！

## 📦 发布

本项目通过npm发布，查看 [发布指南](./PUBLISH.md) 了解如何发布新版本。

## 📄 许可证

MIT License
npm package: @keyuerong/npm-demo
Description: ## Project setup ``` npm install ```
Latest version: 2.0.0

# npm-demo

## Project setup
```
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
```

### Compiles and minifies for production
```
npm run build
```

### Lints and fixes files
```
npm run lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
npm package: @keyunsimejiya/react-native-dropdown-menu
Description: A performant, fully customizable dropdown menu for React Native with single/multi-select, search, auto-positioning, and chip display.
Author: Keyun
Latest version: 1.0.1

# react-native-dropdown-menu

A performant, fully customizable dropdown for React Native — single & multi-select, searchable, auto-positioning, chips, zero dependencies.

## Features

- ✅ Single & multi-select
- ✅ Searchable / filterable
- ✅ Auto-positioning (above/below)
- ✅ Chip display for multi-select
- ✅ Controlled & uncontrolled modes
- ✅ Full theming (colors, icons, styles)
- ✅ Custom render functions
- ✅ Android back button handling
- ✅ Keyboard-aware auto-dismiss
- ✅ TypeScript-first
- ✅ Zero runtime dependencies

## Installation

‍‍‍bash
npm install react-native-dropdown-menu
# or
yarn add react-native-dropdown-menu
‍‍‍

No native linking required. Pure JS.

## Quick Start

‍‍‍tsx
import { DropDownMenu } from 'react-native-dropdown-menu';

const ITEMS = [
  { label: 'Apple', value: 'apple' },
  { label: 'Banana', value: 'banana' },
  { label: 'Cherry', value: 'cherry' },
];

export default function App() {
  const [value, setValue] = useState(null);

  return (
    <DropDownMenu
      data={ITEMS}
      value={value}
      onSelect={setValue}
      placeholder="Pick a fruit"
    />
  );
}
‍‍‍

## Multi-Select

‍‍‍tsx
const [values, setValues] = useState([]);

<DropDownMenu
  data={ITEMS}
  value={values}
  onSelect={setValues}
  multiple
  searchable
  maxSelections={3}
/>
‍‍‍

## Theming

‍‍‍tsx
<DropDownMenu
  data={ITEMS}
  value={value}
  onSelect={setValue}
  colors={{
    primary: '#6C63FF',
    background: '#1A1A2E',
    text: '#EAEAEA',
    border: '#333',
    chipBackground: '#2A2A3E',
  }}
/>
‍‍‍

## Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `data` | `DropDownItem[]` | **required** | Array of `{ label, value }` |
| `value` | `string \| number \| null \| array` | **required** | Selected value(s) |
| `onSelect` | `(value) => void` | — | Selection callback |
| `placeholder` | `string` | `'Select item'` | Placeholder text |
| `title` | `string` | — | Label above trigger |
| `multiple` | `boolean` | `false` | Enable multi-select |
| `searchable` | `boolean` | `false` | Enable search |
| `maxSelections` | `number` | — | Max multi-select items |
| `dropDownDirection` | `'AUTO' \| 'TOP' \| 'BOTTOM'` | `'AUTO'` | Force direction |
| `isOpen` | `boolean` | — | Controlled open state |
| `onOpenChange` | `(open) => void` | — | Open state callback |
| `showError` | `boolean` | `false` | Show error message |
| `errorMessage` | `string` | — | Custom error text |
| `colors` | `DropDownColors` | defaults | Theme colors |
| `icons` | `DropDownIcons` | fallbacks | Custom icon sources |

## License

MIT
npm package: @keyur-gondaliya/3d-sun
Description: 3D Sun is a React component that renders an interactive 3D representation of the sun. You can also provide custom as per needed. It is Three.js Based package so make sure you have it installed already.
Author: Keyur Gondaliya
Latest version: 0.2.1

# @keyur-gondaliya/3d-sun

3D Sun is a React component that renders an interactive 3D representation of the sun. You can also provide custom as per needed. It is Three.js Based package so make sure you have it installed already.

## Installation

```bash
npm install @keyur-gondaliya/3d-sun three
```

## Usage

```bash
import React from 'react';
import { ThreeScene }  from '@keyur-gondaliya/3d-sun';

const YourComponent = () => {
  return (
    <div>
      <ThreeScene
        backgroundImage="URL_TO_YOUR_BACKGROUND_IMAGE"
        sunUVLayoutImage="URL_TO_YOUR_SUN_UV_IMAGE"
        sunTextureImage="URL_TO_YOUR_SUN_TEXTURE_IMAGE"
        disableBackground={false}
        starCount={1000}
        rotationSpeed={0.004}
        orbitColor={0xff0000}
      />
    </div>
  );
};

export default YourComponent;
```

## Props

```bash
backgroundImage (string)
URL for the background image.

sunUVLayoutImage (string)
URL for the sun's UV layout image.

sunTextureImage (string)
URL for the sun's texture image.

disableBackground (boolean)
Default: false
Set to true to disable the background.

starCount (number)
Range: 0 to 100000
Number of stars to be displayed.

rotationSpeed (number)
Range: 0 to 1
Speed of the sun's rotation.

orbitColor (number)
Color input in the hexadecimal format. Example: 0xff0000 (Red)
```

## Example

```bash
<ThreeScene
  backgroundImage="https://example.com/background.jpg"
  sunUVLayoutImage="https://example.com/uvlayout.jpg"
  sunTextureImage="https://example.com/suntexture.jpg"
  disableBackground={false}
  starCount={1000}
  rotationSpeed={0.004}
  orbitColor={0xff0000}
/>
```

Make sure to provide valid image URLs for backgroundImage, sunUVLayoutImage, and sunTextureImage.

For further customization and functionality, explore the props and their expected values.

### Happy coding!
npm package: @keyv/offline
Description: Offline storage adapter for Keyv
Author: Jared Wray
Latest version: 4.0.2
Deprecated: Offline and tiered mode are now built into the cacheable library and is powered by Keyv. Please use https://www.npmjs.com/package/cacheable

# @keyv/offline [<img width="100" align="right" src="https://jaredwray.com/images/keyv-symbol.svg" alt="keyv">](https://github.com/jaredwra/keyv)

> Offline storage adapter for Keyv

[![build](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml/badge.svg)](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml)
[![codecov](https://codecov.io/gh/jaredwray/keyv/branch/main/graph/badge.svg?token=bRzR3RyOXZ)](https://codecov.io/gh/jaredwray/keyv)
[![npm](https://img.shields.io/npm/v/@keyv/offline.svg)](https://www.npmjs.com/package/@keyv/offline)
[![npm](https://img.shields.io/npm/dm/@keyv/offline)](https://npmjs.com/package/@keyv/offline)

# Feature is Deprecated

This feature is deprecated and will be removed in 2025 as it is no longer needed. 

`offline` and `tiered` mode for caching is built into the core [Cacheable](https://cacheable.org) library which uses Keyv under the hood. Please use the `Cacheable` library for `offline` and `tiered` caching.

## Install

```shell
npm install --save keyv @keyv/offline
```

## Usage

```js
import Keyv from 'keyv';
import KeyvOffline from '@keyv/offline';

const keyvOffline = new KeyvOffline(new Keyv());

keyvOffline.on('error', handleConnectionError);
```

## License

[MIT © Jared Wray](LISCENCE)
npm package: @keyv/serialize-msgpackr
Description: MessagePack serialization adapter for Keyv using msgpackr
Author: Jared Wray
Latest version: 6.0.0-alpha.3

# @keyv/serialize-msgpackr [<img width="100" align="right" src="https://jaredwray.com/images/keyv-symbol.svg" alt="keyv">](https://github.com/jaredwray/keyv)

> High-performance MessagePack serializer for [Keyv](https://github.com/jaredwray/keyv) using [msgpackr](https://github.com/kriszyp/msgpackr)

[![build](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml/badge.svg)](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml)
[![codecov](https://codecov.io/gh/jaredwray/keyv/branch/main/graph/badge.svg?token=bRzR3RyOXZ)](https://codecov.io/gh/jaredwray/keyv)
[![GitHub license](https://img.shields.io/github/license/jaredwray/keyv)](https://github.com/jaredwray/keyv/blob/main/LICENSE)
[![npm](https://img.shields.io/npm/dm/@keyv/serialize-msgpackr)](https://npmjs.com/package/@keyv/serialize-msgpackr)

`@keyv/serialize-msgpackr` is a serialization adapter for [Keyv](https://github.com/jaredwray/keyv/tree/main/core/keyv) powered by [msgpackr](https://github.com/kriszyp/msgpackr). It uses the MessagePack binary format for high-performance serialization with rich type support.

## Supported Types

In addition to all standard JSON types, msgpackr supports:

- `Date`
- `RegExp`
- `Map`
- `Set`
- `Error`
- `undefined`
- `NaN`, `Infinity`, `-Infinity`

Binary data is base64-encoded for compatibility with string-based storage adapters.

## Installation

```bash
npm install @keyv/serialize-msgpackr
```

> **Note:** `keyv` is a peer dependency and must be installed alongside this package.

## Usage

```js
import Keyv from 'keyv';
import { msgpackrSerializer } from '@keyv/serialize-msgpackr';

const keyv = new Keyv({ serialization: msgpackrSerializer });

// Store a Date — it comes back as a Date, not a string
await keyv.set('date', new Date('2024-01-15'));
const date = await keyv.get('date');
console.log(date instanceof Date); // true

// Store a Map
await keyv.set('map', new Map([['a', 1], ['b', 2]]));
const map = await keyv.get('map');
console.log(map instanceof Map); // true
console.log(map.get('a')); // 1

// Store a Set
await keyv.set('set', new Set([1, 2, 3]));
const set = await keyv.get('set');
console.log(set instanceof Set); // true
```

## API

### `KeyvMsgpackrSerializer`

A class that implements the `KeyvSerializationAdapter` interface from `keyv`.

```js
import { KeyvMsgpackrSerializer } from '@keyv/serialize-msgpackr';

const serializer = new KeyvMsgpackrSerializer();
```

#### `stringify(object: unknown): string`

Serializes a value to a base64-encoded MessagePack string using msgpackr.

#### `parse<T>(data: string): T`

Deserializes a base64-encoded MessagePack string back to its original value with all types restored.

### `msgpackrSerializer`

A default `KeyvMsgpackrSerializer` instance, ready to use.

```js
import { msgpackrSerializer } from '@keyv/serialize-msgpackr';
```

## License

[MIT © Jared Wray](LICENSE)
npm package: @keyv/serialize-superjson
Description: SuperJSON serialization adapter for Keyv
Author: Jared Wray
Latest version: 6.0.0-alpha.3

# @keyv/serialize-superjson [<img width="100" align="right" src="https://jaredwray.com/images/keyv-symbol.svg" alt="keyv">](https://github.com/jaredwray/keyv)

> SuperJSON-based serializer for [Keyv](https://github.com/jaredwray/keyv) with support for Date, Map, Set, BigInt, RegExp, and more

[![build](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml/badge.svg)](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml)
[![codecov](https://codecov.io/gh/jaredwray/keyv/branch/main/graph/badge.svg?token=bRzR3RyOXZ)](https://codecov.io/gh/jaredwray/keyv)
[![GitHub license](https://img.shields.io/github/license/jaredwray/keyv)](https://github.com/jaredwray/keyv/blob/main/LICENSE)
[![npm](https://img.shields.io/npm/dm/@keyv/serialize-superjson)](https://npmjs.com/package/@keyv/serialize-superjson)

`@keyv/serialize-superjson` is a serialization adapter for [Keyv](https://github.com/jaredwray/keyv/tree/main/core/keyv) powered by [SuperJSON](https://github.com/flightcontrolhq/superjson). It preserves JavaScript types that standard JSON does not support.

## Supported Types

In addition to all standard JSON types, SuperJSON supports:

- `Date`
- `RegExp`
- `Map`
- `Set`
- `BigInt`
- `undefined`
- `Error`
- `URL`

## Installation

```bash
npm install @keyv/serialize-superjson
```

> **Note:** `keyv` is a peer dependency and must be installed alongside this package.

## Usage

```js
import Keyv from 'keyv';
import { superJsonSerializer } from '@keyv/serialize-superjson';

const keyv = new Keyv({ serialization: superJsonSerializer });

// Store a Date — it comes back as a Date, not a string
await keyv.set('date', new Date('2024-01-15'));
const date = await keyv.get('date');
console.log(date instanceof Date); // true

// Store a Map
await keyv.set('map', new Map([['a', 1], ['b', 2]]));
const map = await keyv.get('map');
console.log(map instanceof Map); // true
console.log(map.get('a')); // 1

// Store a Set
await keyv.set('set', new Set([1, 2, 3]));
const set = await keyv.get('set');
console.log(set instanceof Set); // true
```

## API

### `KeyvSuperJsonSerializer`

A class that implements the `KeyvSerializationAdapter` interface from `keyv`.

```js
import { KeyvSuperJsonSerializer } from '@keyv/serialize-superjson';

const serializer = new KeyvSuperJsonSerializer();
```

#### `stringify(object: unknown): string`

Serializes a value to a JSON string using SuperJSON, preserving type information.

#### `parse<T>(data: string): T`

Deserializes a SuperJSON string back to its original value with all types restored.

### `superJsonSerializer`

A default `KeyvSuperJsonSerializer` instance, ready to use.

```js
import { superJsonSerializer } from '@keyv/serialize-superjson';
```

## License

[MIT © Jared Wray](LICENSE)
npm package: @keyv/sql
Description: Parent class for SQL based Keyv storage adapters
Author: Jared Wray
Latest version: 1.1.4

## :warning: This project is now archived and no longer maintained.

# @keyv/sql [<img width="100" align="right" src="https://rawgit.com/lukechilds/keyv/master/media/logo.svg" alt="keyv">](https://github.com/lukechilds/keyv)

> Parent class for SQL based Keyv storage adapters

[![build](https://github.com/jaredwray/keyv-sql/actions/workflows/build.yaml/badge.svg)](https://github.com/jaredwray/keyv-sql/actions/workflows/build.yaml)
[![Coverage Status](https://coveralls.io/repos/github/lukechilds/keyv-sql/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/keyv-sql?branch=master)
[![npm](https://img.shields.io/npm/v/@keyv/sql.svg)](https://www.npmjs.com/package/@keyv/sql)

Parent class containing the common logic for SQL based Keyv storage adapters:

- [`keyv-sqlite`](https://github.com/lukechilds/keyv-sqlite)
- [`keyv-postgres`](https://github.com/lukechilds/keyv-postgres)
- [`keyv-mysql`](https://github.com/lukechilds/keyv-mysql)

## License

MIT © Jared Wray & Luke Childs
npm package: @keyv/tiered
Description: Tiered storage adapter for Keyv
Author: Jared Wray
Latest version: 2.0.2
Deprecated: Offline and tiered mode are now built into the cacheable library and is powered by Keyv. Please use https://www.npmjs.com/package/cacheable

# @keyv/tiered [<img width="100" align="right" src="https://jaredwray.com/images/keyv-symbol.svg" alt="keyv">](https://github.com/jaredwra/keyv)

> Tiered storage adapter for Keyv to manage local and remote store as one for Keyv

[![build](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml/badge.svg)](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml)
[![codecov](https://codecov.io/gh/jaredwray/keyv/branch/main/graph/badge.svg?token=bRzR3RyOXZ)](https://codecov.io/gh/jaredwray/keyv)
[![npm](https://img.shields.io/npm/v/@keyv/tiered.svg)](https://www.npmjs.com/package/@keyv/tiered)
[![npm](https://img.shields.io/npm/dm/@keyv/tiered)](https://npmjs.com/package/@keyv/tiered)

# Feature is Deprecated

This feature is deprecated and will be removed in 2025 as it is no longer needed. 

`offline` and `tiered` mode for caching is built into the core [Cacheable](https://cacheable.org) library which uses Keyv under the hood. Please use the `Cacheable` library for `offline` and `tiered` caching.

## Install

```shell
npm install --save keyv @keyv/tiered
```

## Usage

First, you need to provide your `local` and `remote` stores to be used, being possible to use any [Keyv storage adapter](https://github.com/jaredwray/keyv#storage-adapters):

```js
import Keyv from 'keyv';
import KeyvTiered from '@keyv/tiered';
import KeyvSqlite from '@keyv/sqlite';

const remoteStore = () => new Keyv({
	store: new KeyvSqlite({
		uri: 'sqlite://test/testdb.sqlite',
		busyTimeout: 30_000,
	}),
});
const localStore = () => new Keyv();
const remote = remoteStore();
const local = localStore();
const store = new KeyvTiered({remote, local});
const keyv = new Keyv({store});
keyv.on('error', handleConnectionError);
```

## API

### KeyvTiered(\[options])

#### options

##### local

Type: `Object`<br/>
Default: `new Keyv()`

A keyv instance to be used as local strategy.

##### remote

Type: `Object`<br/>
Default: `new Keyv()`

A keyv instance to be used as remote strategy.

##### validator

Type: `Function`<br/>
Default: `() =>  true`

The validator function is used as a precondition to determining is remote storage should be checked.

## License

[MIT © Jared Wray](LISCENCE)
npm package: @keyvaluesystems/react-native-scribble
Description: React native package to capture user scribbling on screen and convert it to an svg image
Author: Keyvalue
Latest version: 1.2.1

# react-native-scribble

React native package to capture user scribbling on screen and converting it to an svg image

## Installation

```sh
npm i @keyvaluesystems/react-native-scribble
```

## Usage

```jsx
import { SvgCapture ,useSvgCapture } from '@keyvaluesystems/react-native-scribble';
  // ...
  const signatureProps = useSvgCapture();
  const { clearPad, getFilePath } = signatureProps;

  const handleFileGeneration = async () => {
    const filePath = await getFilePath();
  };
  // ...
  return (
    <>
      <SvgCapture {...signatureProps} />
      <Button title="Clear" onClick={clearPad} />
      <Button title="Save" onClick={handleFileGeneration} />
    </>
  );
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---

Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
npm package: @keyvhq/compress
Description: Adds compression bindings for your Keyv instance, saving as much space as you can.
Author: microlink.io
Latest version: 2.2.0

# @keyvhq/compress [<img width="100" align="right" src="https://keyvhq.js.org/media/logo-sunset.svg" alt="keyv">](https://github.com/microlinkhq/keyvhq)

> Adds compression bindings for your Keyv instance.

## Install

```bash
$ npm install @keyvhq/compress --save
```

## Usage

All you need to do is to wrap your [keyv](https://keyvhq.js.org) instance:

```js
const KeyvRedis = require('@keyvhq/redis')
const Keyv = require('@keyvhq/core')

const store = new KeyvRedis({
  uri: 'redis://user:pass@localhost:6379',
  maxRetriesPerRequest: 1
})

const keyv = new Keyv({ store })
```

Using `@keyvhq/compress` at the top level:

```js
const KeyvCompress = require('@keyvhq/compress')
const keyv = KeyvCompress(new Keyv({ store }))
```

Additionally, it can accept [compress-brotli#options](https://github.com/Kikobeats/compress-brotli#compressbrotlioptions) as second argument:

```js
const keyv = KeyvCompress(
  new Keyv({ store }),
  {
    serialize: v8.serialize,
    deserialize: v8.deserialize
  }
)
```

## License

**@keyvhq/memoize** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/microlinkhq/keyvhq/blob/master/LICENSE.md) License.<br/>
Maintained by [Microlink](https://microlink.io) with help from [contributors](https://github.com/microlinkhq/keyvhq/contributors).

> [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · X [@microlinkhq](https://x.com/microlinkhq)
npm package: @keyvhq/file
Description: A file storage adapter for Keyv
Author: microlink.io
Latest version: 2.1.15

# @keyvhq/file [<img width="100" align="right" src="https://keyvhq.js.org/media/logo-sunset.svg" alt="keyv">](https://github.com/microlinkhq/keyv/packages/file)

> A file storage adapter for [Keyv](https://github.com/microlinkhq/keyv).

## Install

```shell
npm install --save @keyvhq/core @keyvhq/file
```

## Usage

```js
const KeyvFile = require('@keyvhq/file')
const Keyv = require('@keyvhq/core')

const keyv = new Keyv({
  store: new KeyvFile('./myfile')
})
```

## License

**@keyvhq/file** © [Luke Childs](https://lukechilds.co), released under the [MIT](https://github.com/microlinkhq/keyvhq/blob/master/LICENSE.md) License.<br/>
Maintained by [Microlink](https://microlink.io) with help from [contributors](https://github.com/microlinkhq/keyvhq/contributors).

> [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · X [@microlinkhq](https://x.com/microlinkhq)
npm package: @keyvhq/keyv-mongo
Description: MongoDB storage adapter for Keyv
Author: microlink.io
Latest version: 1.0.0
Deprecated: Package has been renamed to @keyvhq/mongo

# @keyv/mongo [<img width="100" align="right" src="https://rawgit.com/lukechilds/keyv/master/media/logo.svg" alt="keyv">](https://github.com/lukechilds/keyv)

> MongoDB storage adapter for Keyv

[![Build Status](https://travis-ci.org/lukechilds/keyv-mongo.svg?branch=master)](https://travis-ci.org/lukechilds/keyv-mongo)
[![Coverage Status](https://coveralls.io/repos/github/lukechilds/keyv-mongo/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/keyv-mongo?branch=master)
[![npm](https://img.shields.io/npm/v/@keyv/mongo.svg)](https://www.npmjs.com/package/@keyv/mongo)

MongoDB storage adapter for [Keyv](https://github.com/lukechilds/keyv).

Uses TTL indexes to automatically remove expired documents. However [MongoDB doesn't guarantee data will be deleted immediately upon expiration](https://docs.mongodb.com/manual/core/index-ttl/#timing-of-the-delete-operation), so expiry dates are revalidated in Keyv.

## Install

```shell
npm install --save keyv @keyv/mongo
```

## Usage

```js
const Keyv = require('keyv')

const keyv = new Keyv('mongodb://user:pass@localhost:27017/dbname')
keyv.on('error', handleConnectionError)
```

You can specify the collection name, by default `'keyv'` is used.

e.g:

```js
const keyv = new Keyv('mongodb://user:pass@localhost:27017/dbname', { collection: 'cache' })
```

## License

**keyv** © [Luke Childs](https://github.com/lukechilds), Released under the [MIT](/LICENSE.md) License.<br>
Maintained by [Kiko Beats](https://kikobeats.com) and [Jytesh](https://github.com/Jytesh), with help from [contributors](https://github.com/microlinkhq/keyv/contributors).
npm package: @keyvhq/keyv-mysql
Description: MySQL/MariaDB storage adapter for Keyv
Author: microlink.io
Latest version: 1.0.0
Deprecated: Package has been renamed to @keyvhq/mysql

# @keyv/mysql [<img width="100" align="right" src="https://rawgit.com/lukechilds/keyv/master/media/logo.svg" alt="keyv">](https://github.com/lukechilds/keyv)

> MySQL/MariaDB storage adapter for Keyv

[![Build Status](https://travis-ci.org/lukechilds/keyv-mysql.svg?branch=master)](https://travis-ci.org/lukechilds/keyv-mysql)
[![Coverage Status](https://coveralls.io/repos/github/lukechilds/keyv-mysql/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/keyv-mysql?branch=master)
[![npm](https://img.shields.io/npm/v/@keyv/mysql.svg)](https://www.npmjs.com/package/@keyv/mysql)

MySQL/MariaDB storage adapter for [Keyv](https://github.com/lukechilds/keyv).

## Install

```shell
npm install --save keyv @keyv/mysql
```

## Usage

```js
const Keyv = require('keyv')

const keyv = new Keyv('mysql://user:pass@localhost:3306/dbname')
keyv.on('error', handleConnectionError)
```

You can specify a custom table with the `table` option and the primary key size with `keySize`.

e.g:

```js
const keyv = new Keyv('mysql://user:pass@localhost:3306/dbname', {
  table: 'cache',
  keySize: 255
})
```

**Note:** Some MySQL/MariaDB installations won't allow a key size longer than 767 bytes. If you get an error on table creation try reducing `keySize` to 191 or lower. [#5](https://github.com/lukechilds/keyv-sql/issues/5)

## License

**keyv** © [Luke Childs](https://github.com/lukechilds), Released under the [MIT](/LICENSE.md) License.<br>
Maintained by [Kiko Beats](https://kikobeats.com) and [Jytesh](https://github.com/Jytesh), with help from [contributors](https://github.com/microlinkhq/keyv/contributors).
npm package: @keyvhq/keyv-postgres
Description: PostgreSQL storage adapter for Keyv
Author: microlink.io
Latest version: 1.0.0
Deprecated: Package has been renamed to @keyvhq/postgres

# @keyv/postgres [<img width="100" align="right" src="https://rawgit.com/lukechilds/keyv/master/media/logo.svg" alt="keyv">](https://github.com/lukechilds/keyv)

> PostgreSQL storage adapter for Keyv

[![Build Status](https://travis-ci.org/lukechilds/keyv-postgres.svg?branch=master)](https://travis-ci.org/lukechilds/keyv-postgres)
[![Coverage Status](https://coveralls.io/repos/github/lukechilds/keyv-postgres/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/keyv-postgres?branch=master)
[![npm](https://img.shields.io/npm/v/@keyv/postgres.svg)](https://www.npmjs.com/package/@keyv/postgres)

PostgreSQL storage adapter for [Keyv](https://github.com/lukechilds/keyv).

Requires Postgres 9.5 or newer for `ON CONFLICT` support to allow performant upserts. [Why?](https://stackoverflow.com/questions/17267417/how-to-upsert-merge-insert-on-duplicate-update-in-postgresql/17267423#17267423)

## Install

```shell
npm install --save keyv @keyv/postgres
```

## Usage

```js
const Keyv = require('keyv')

const keyv = new Keyv('postgresql://user:pass@localhost:5432/dbname')
keyv.on('error', handleConnectionError)
```

You can specify the `table` option.

e.g:

```js
const keyv = new Keyv('postgresql://user:pass@localhost:5432/dbname', { table: 'cache' })
```

## License

**keyv** © [Luke Childs](https://github.com/lukechilds), Released under the [MIT](/LICENSE.md) License.<br>
Maintained by [Kiko Beats](https://kikobeats.com) and [Jytesh](https://github.com/Jytesh), with help from [contributors](https://github.com/microlinkhq/keyv/contributors).
npm package: @keyvhq/keyv-redis
Description: Redis storage adapter for Keyv
Author: microlink.io
Latest version: 1.0.0
Deprecated: Package has been renamed to @keyvhq/redis

# @keyv/redis [<img width="100" align="right" src="https://rawgit.com/lukechilds/keyv/master/media/logo.svg" alt="keyv">](https://github.com/lukechilds/keyv)

> Redis storage adapter for Keyv

[![Build Status](https://travis-ci.org/lukechilds/keyv-redis.svg?branch=master)](https://travis-ci.org/lukechilds/keyv-redis)
[![Coverage Status](https://coveralls.io/repos/github/lukechilds/keyv-redis/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/keyv-redis?branch=master)
[![npm](https://img.shields.io/npm/v/@keyv/redis.svg)](https://www.npmjs.com/package/@keyv/redis)

Redis storage adapter for [Keyv](https://github.com/lukechilds/keyv).

TTL functionality is handled directly by Redis so no timestamps are stored and expired keys are cleaned up internally.

## Install

```shell
npm install --save keyv @keyv/redis
```

## Usage

```js
const Keyv = require('keyv')

const keyv = new Keyv('redis://user:pass@localhost:6379')
keyv.on('error', handleConnectionError)
```

Any valid [`Redis`](https://github.com/luin/ioredis#connect-to-redis) options will be passed directly through.

e.g:

```js
const keyv = new Keyv('redis://user:pass@localhost:6379', { disable_resubscribing: true })
```

Or you can manually create a storage adapter instance and pass it to Keyv:

```js
const KeyvRedis = require('@keyv/redis')
const Keyv = require('keyv')

const keyvRedis = new KeyvRedis('redis://user:pass@localhost:6379')
const keyv = new Keyv({ store: keyvRedis })
```

Or reuse a previous Redis instance:

```js
const KeyvRedis = require('@keyv/redis')
const Redis = require('ioredis')
const Keyv = require('keyv')

const redis = new Redis('redis://user:pass@localhost:6379')
const keyvRedis = new KeyvRedis(redis)
const keyv = new Keyv({ store: keyvRedis })
```

## License

**keyv** © [Luke Childs](https://github.com/lukechilds), Released under the [MIT](/LICENSE.md) License.<br>
Maintained by [Kiko Beats](https://kikobeats.com) and [Jytesh](https://github.com/Jytesh), with help from [contributors](https://github.com/microlinkhq/keyv/contributors).
npm package: @keyvhq/keyv-sql
Description: Parent class for SQL based Keyv storage adapters
Author: microlink.io
Latest version: 1.0.0

# @keyv/sql [<img width="100" align="right" src="https://rawgit.com/lukechilds/keyv/master/media/logo.svg" alt="keyv">](https://github.com/lukechilds/keyv)

> Parent class for SQL based Keyv storage adapters

[![Build Status](https://travis-ci.org/lukechilds/keyv-sql.svg?branch=master)](https://travis-ci.org/lukechilds/keyv-sql)
[![Coverage Status](https://coveralls.io/repos/github/lukechilds/keyv-sql/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/keyv-sql?branch=master)
[![npm](https://img.shields.io/npm/v/@keyv/sql.svg)](https://www.npmjs.com/package/@keyv/sql)

Parent class containing the common logic for SQL based Keyv storage adapters:

- [`keyv-sqlite`](https://github.com/lukechilds/keyv-sqlite)
- [`keyv-postgres`](https://github.com/lukechilds/keyv-postgres)
- [`keyv-mysql`](https://github.com/lukechilds/keyv-mysql)

## License

**keyv** © [Luke Childs](https://github.com/lukechilds), Released under the [MIT](/LICENSE.md) License.<br>
Maintained by [Kiko Beats](https://kikobeats.com) and [Jytesh](https://github.com/Jytesh), with help from [contributors](https://github.com/microlinkhq/keyv/contributors).
npm package: @keyvhq/keyv-sqlite
Description: SQLite storage adapter for Keyv
Author: microlink.io
Latest version: 1.0.0
Deprecated: Package has been renamed to @keyvhq/sqlite

# @keyv/sqlite [<img width="100" align="right" src="https://rawgit.com/lukechilds/keyv/master/media/logo.svg" alt="keyv">](https://github.com/lukechilds/keyv)

> SQLite storage adapter for Keyv

[![Build Status](https://travis-ci.org/lukechilds/keyv-sqlite.svg?branch=master)](https://travis-ci.org/lukechilds/keyv-sqlite)
[![Coverage Status](https://coveralls.io/repos/github/lukechilds/keyv-sqlite/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/keyv-sqlite?branch=master)
[![npm](https://img.shields.io/npm/v/@keyv/sqlite.svg)](https://www.npmjs.com/package/@keyv/sqlite)

SQLite storage adapter for [Keyv](https://github.com/lukechilds/keyv).

## Install

```shell
npm install --save keyv @keyv/sqlite
```

## Usage

```js
const Keyv = require('keyv')

const keyv = new Keyv('sqlite://path/to/database.sqlite')
keyv.on('error', handleConnectionError)
```

You can specify the `table` and [`busyTimeout`](https://sqlite.org/c3ref/busy_timeout.html) option.

e.g:

```js
const keyv = new Keyv('sqlite://path/to/database.sqlite', {
  table: 'cache',
  busyTimeout: 10000
})
```

## License

**keyv** © [Luke Childs](https://github.com/lukechilds), Released under the [MIT](/LICENSE.md) License.<br>
Maintained by [Kiko Beats](https://kikobeats.com) and [Jytesh](https://github.com/Jytesh), with help from [contributors](https://github.com/microlinkhq/keyv/contributors).
npm package: @keyvhq/keyv-test-suite
Description: Test suite for Keyv API compliancy
Author: microlink.io
Latest version: 1.0.0

# @keyv/test-suite [<img width="100" align="right" src="https://rawgit.com/lukechilds/keyv/master/media/logo.svg" alt="keyv">](https://github.com/lukechilds/keyv)

> Test suite for Keyv API compliance

[![Build Status](https://travis-ci.org/lukechilds/keyv-test-suite.svg?branch=master)](https://travis-ci.org/lukechilds/keyv-test-suite)
[![Coverage Status](https://coveralls.io/repos/github/lukechilds/keyv-test-suite/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/keyv-test-suite?branch=master)
[![npm](https://img.shields.io/npm/v/@keyv/test-suite.svg)](https://www.npmjs.com/package/@keyv/test-suite)

Complete [AVA](https://github.com/avajs/ava) test suite to test a [Keyv](https://github.com/lukechilds/keyv) storage adapter for API compliance.

## Usage

### Install

Install AVA, Keyv and `@keyv/test-suite` as development dependencies.

```shell
npm install --save-dev ava keyv @keyv/test-suite
```

Then update `keyv` and `@keyv/test-suite` versions to `*` in `package.json` to ensure you're always testing against the latest version.

### Create Test File

`test.js`

```js
import test from 'ava'
import keyvTestSuite from '@keyv/test-suite'
import Keyv from 'keyv'
import KeyvStore from './'

const store = () => new KeyvStore()
keyvTestSuite(test, Keyv, store)
```

Where `KeyvStore` is your storage adapter.

Set your test script in `package.json` to `ava`.
```json
"scripts": {
  "test": "ava"
}
```

### Test on Active Node.js LTS and Higher

An example configuration for Travis CI would look like this:

`.travis.yml`

```yaml
language: node_js
node_js:
  - '8'
  - '6'
  - '4'
script: npm test
```

## Example

Take a look at [keyv-redis](https://github.com/lukechilds/keyv-redis) for an example of an existing storage adapter using `@keyv/test-suite`.

## License

**keyv** © [Luke Childs](https://github.com/lukechilds), Released under the [MIT](/LICENSE.md) License.<br>
Maintained by [Kiko Beats](https://kikobeats.com) and [Jytesh](https://github.com/Jytesh), with help from [contributors](https://github.com/microlinkhq/keyv/contributors).
npm package: @keyvhq/mongo
Description: MongoDB storage adapter for Keyv
Author: microlink.io
Latest version: 2.1.15

# @keyvhq/mongo [<img width="100" align="right" src="https://keyvhq.js.org/media/logo-sunset.svg" alt="keyv">](https://github.com/microlinkhq/keyv/packages/mongo)

> MongoDB storage adapter for [Keyv](https://github.com/microlinkhq/keyv).

Uses TTL indexes to automatically remove expired documents. However [MongoDB doesn't guarantee data will be deleted immediately upon expiration](https://docs.mongodb.com/manual/core/index-ttl/#timing-of-the-delete-operation), so expiry dates are revalidated in Keyv.

## Install

```shell
npm install --save @keyvhq/core @keyvhq/mongo
```

## Usage

> **NOTE**: The mongo uses `url` instead of `uri` to provide the connection string details.

```js
const KeyvMongo = require('@keyvhq/mongo')
const Keyv = require('@keyvhq/core')

const keyv = new Keyv({
  store: new KeyvMongo('mongodb://user:pass@localhost:27017/dbname')
})
```

You can specify the collection name, by default `'keyv'` is used:

```js
const KeyvMongo = require('@keyvhq/mongo')
const Keyv = require('@keyvhq/core')

const keyv = new Keyv({
  store: new KeyvMongo('mongodb://user:pass@localhost:27017/dbname', {
    collection: 'cache'
  })
})
```

## License

**@keyvhq/mongo** © [Luke Childs](https://lukechilds.co), released under the [MIT](https://github.com/microlinkhq/keyvhq/blob/master/LICENSE.md) License.<br/>
Maintained by [Microlink](https://microlink.io) with help from [contributors](https://github.com/microlinkhq/keyvhq/contributors).

> [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · X [@microlinkhq](https://x.com/microlinkhq)
npm package: @keyvhq/multi
Description: Layered cache with any backend
Author: microlink.io
Latest version: 2.1.15

# @keyvhq/multi [<img width="100" align="right" src="https://keyvhq.js.org/media/logo-sunset.svg" alt="keyv">](https://github.com/microlinkhq/keyv/packages/multi)

> A multi storage adapter to manage local and remote store as one for Keyv.

## Install

```shell
npm install --save @keyvhq/multi
```

## Usage

First, you need to provide your `local` and `remote` stores to be used, being possible to use any [Keyv storage adapter](https://keyvhq.js.org/#/?id=storage-adapters-1#/?id=storage-adapters-1#/?id=storage-adapters-1):

```js
const KeyvMulti = require('@keyvhq/multi')
const KeyvRedis = require('@keyvhq/redis')
const Keyv = require('@keyvhq/core')

const keyv = new Keyv({
  store: new KeyvMulti({
    local: new Map(),
    remote: new KeyvRedis()
  })
})
```

After that, just interact with the store as a single [keyv](https://keyvhq.js.org/#/?id=usage#/?id=usage#/?id=usage) instance.

The actions will be performed in parallel when is possible, and the stores will fallback between them to keep them in synchronized.

## API

### multi(\[options])

#### options

##### local

Type: `Object`<br/>
Default: `new Keyv()`

A keyv instance to be used as local strategy.

##### remote

Type: `Object`<br/>
Default: `new Keyv()`

A keyv instance to be used as remote strategy.

##### validator

Type: `Function`<br/>
Default: `() =>  true`

The validator function is used as a precondition to determining is remote storage should be checked.

## License

**@keyvhq/multi** © [Jytesh](https://github.com/Jytesh), released under the [MIT](https://github.com/microlinkhq/keyvhq/blob/master/LICENSE.md) License.<br/>
Maintained by [Microlink](https://microlink.io) with help from [contributors](https://github.com/microlinkhq/keyvhq/contributors).

> [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · X [@microlinkhq](https://x.com/microlinkhq)
npm package: @keyvhq/mysql
Description: MySQL/MariaDB storage adapter for Keyv
Author: microlink.io
Latest version: 2.2.0

# @keyvhq/mysql [<img width="100" align="right" src="https://keyvhq.js.org/media/logo-sunset.svg" alt="keyv">](https://github.com/microlinkhq/keyv/packages/mysql)

> MySQL/MariaDB storage adapter for [Keyv](https://github.com/microlinkhq/keyv).

## Install

```shell
npm install --save @keyvhq/core @keyvhq/mysql
```

## Usage

```js
const KeyvMysql = require('@keyvhq/redis')
const Keyv = require('@keyvhq/core')

const keyv = new Keyv({
  store: new KeyvMysql('mysql://user:pass@localhost:3306/dbname')
})
```

You can specify a custom table with the `table` option and the primary key size with `keySize`:

```js
const KeyvMysql = require('@keyvhq/redis')
const Keyv = require('@keyvhq/core')

const keyv = new Keyv({
  store: new KeyvMysql('mysql://user:pass@localhost:3306/dbname', {
    table: 'cache',
    keySize: 255
  })
})
```

**Note:** Some MySQL/MariaDB installations won't allow a key size longer than 767 bytes. If you get an error on table creation try reducing `keySize` to 191 or lower.

## License

**@keyvhq/mysql** © [Luke Childs](https://lukechilds.co), released under the [MIT](https://github.com/microlinkhq/keyvhq/blob/master/LICENSE.md) License.<br/>
Maintained by [Microlink](https://microlink.io) with help from [contributors](https://github.com/microlinkhq/keyvhq/contributors).

> [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · X [@microlinkhq](https://x.com/microlinkhq)
npm package: @keyvhq/offline
Description: Adding offline capabilities for your keyv instance.
Author: microlink.io
Latest version: 2.2.0

# @keyvhq/offline [<img width="100" align="right" src="https://keyvhq.js.org/media/logo-sunset.svg" alt="keyv">](https://github.com/microlinkhq/keyv/packages/offline)

> Adds offline capabilities for your keyv instance.

## Install

```bash
$ npm install @keyvhq/offline --save
```

## Usage

All you need to do is to wrap your [keyv](https://keyvhq.js.org) instance:

```js
const KeyvRedis = require('@keyvhq/redis')
const Keyv = require('@keyvhq/core')

const store = new KeyvRedis({
  uri: 'redis://user:pass@localhost:6379',
  maxRetriesPerRequest: 1
})

const keyv = new Keyv({ store })
```

Using `@keyvhq/offline` at the top level:

```js
const KeyvOffline = require('@keyvhq/offline')
const keyv = keyvOffline(new Keyv({ store }))
```

Since now, if your store suffers network connectivity issues, your keyv set/get petitions will be temporarily bypassed, preventing your application to crash for that, being more resilient than the default keyv behavior.

As soon as the connection is re-established, it will be work back as expected.

In case you need, you can see omitted errors enabling debug doing `DEBUG=@keyvhq/offline*`

## License

**@keyvhq/memoize** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/microlinkhq/keyvhq/blob/master/LICENSE.md) License.<br/>
Maintained by [Microlink](https://microlink.io) with help from [contributors](https://github.com/microlinkhq/keyvhq/contributors).

> [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · X [@microlinkhq](https://x.com/microlinkhq)
npm package: @keyvhq/postgres
Description: PostgreSQL storage adapter for Keyv
Author: microlink.io
Latest version: 2.2.0

# @keyvhq/postgres [<img width="100" align="right" src="https://keyvhq.js.org/media/logo-sunset.svg" alt="keyv">](https://github.com/microlinkhq/keyv/packages/postgres)

> PostgreSQL storage adapter for [Keyv](https://github.com/microlinkhq/keyv).

Requires Postgres 9.5 or newer for `ON CONFLICT` support to allow performant upserts. [Why?](https://stackoverflow.com/questions/17267417/how-to-upsert-merge-insert-on-duplicate-update-in-postgresql/17267423#17267423)

## Install

```shell
npm install --save @keyvhq/core @keyvhq/postgres
```

## Usage

```js
const KeyvPostgres = require('@keyvhq/postgres')
const Keyv = require('@keyvhq/core')

const keyv = new Keyv({
  store: new KeyvPostgres({
    uri: 'postgresql://user:pass@localhost:5432/dbname',
    ssl: {
      rejectUnauthorized: false
    }
  })
})
```

You can specify the `table` option:

```js
const KeyvPostgres = require('@keyvhq/postgres')
const Keyv = require('@keyvhq/core')

const keyv = new Keyv({
  store: new KeyvPostgres('postgresql://user:pass@localhost:5432/dbname', {
    table: 'cache'
  })
})
```

## License

**@keyvhq/postgres** © [Luke Childs](https://lukechilds.co), released under the [MIT](https://github.com/microlinkhq/keyvhq/blob/master/LICENSE.md) License.<br/>
Maintained by [Microlink](https://microlink.io) with help from [contributors](https://github.com/microlinkhq/keyvhq/contributors).

> [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · X [@microlinkhq](https://x.com/microlinkhq)
npm package: @keyvhq/redis
Description: Redis storage adapter for Keyv
Author: microlink.io
Latest version: 2.1.17

# @keyvhq/redis [<img width="100" align="right" src="https://keyvhq.js.org/media/logo-sunset.svg" alt="keyv">](https://github.com/microlinkhq/keyv/packages/redis)

> Redis storage adapter for [Keyv](https://github.com/microlinkhq/keyv).

TTL functionality is handled directly by Redis so no timestamps are stored and expired keys are cleaned up internally.

## Install

```shell
npm install --save @keyvhq/core @keyvhq/redis
```

## Usage

```js
const KeyvRedis = require('@keyvhq/redis')
const Keyv = require('@keyvhq/core')

const keyv = new Keyv({ store: new KeyvRedis('redis://user:pass@localhost:6379') })
```

Any valid [`Redis`](https://github.com/luin/ioredis#connect-to-redis) options will be passed directly through:

```js
const KeyvRedis = require('@keyvhq/redis')
const Keyv = require('@keyvhq/core')

const keyv = new Keyv({
  store: new KeyvRedis('redis://user:pass@localhost:6379', {
    disable_resubscribing: true
  })
})
```

Or you can reuse a previously declared `Redis` instance:

```js
const KeyvRedis = require('@keyvhq/redis')
const Keyv = require('@keyvhq/core')

const { Redis } = KeyvRedis

const redis = new Redis('redis://user:pass@localhost:6379')
const keyv = new Keyv({ store: new KeyvRedis(redis) })
```

## License

**@keyvhq/redis** © [Luke Childs](https://lukechilds.co), released under the [MIT](https://github.com/microlinkhq/keyvhq/blob/master/LICENSE.md) License.<br/>
Maintained by [Microlink](https://microlink.io) with help from [contributors](https://github.com/microlinkhq/keyvhq/contributors).

> [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · X [@microlinkhq](https://x.com/microlinkhq)
npm package: @keyvhq/sql
Description: Parent class for SQL based Keyv storage adapters
Author: microlink.io
Latest version: 2.2.0

# @keyvhq/sql [<img width="100" align="right" src="https://keyvhq.js.org/media/logo-sunset.svg" alt="keyv">](https://github.com/microlinkhq/keyv/packages/sql)

Parent class containing the common logic for SQL based Keyv storage adapters:

- [`@keyvhq/sqlite`](https://github.com/microlinkhq/packageS/sqlite)
- [`@keyvhq/postgres`](https://github.com/microlinkhq/packageS/postgres)
- [`@keyvhq/mysql`](https://github.com/microlinkhq/packageS/mysql)

## License

**@keyvhq/sql** © [Luke Childs](https://lukechilds.co), released under the [MIT](https://github.com/microlinkhq/keyvhq/blob/master/LICENSE.md) License.<br/>
Maintained by [Microlink](https://microlink.io) with help from [contributors](https://github.com/microlinkhq/keyvhq/contributors).

> [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · X [@microlinkhq](https://x.com/microlinkhq)
npm package: @keyvhq/sqlite
Description: SQLite storage adapter for Keyv
Author: microlink.io
Latest version: 2.2.0

# @keyvhq/sqlite [<img width="100" align="right" src="https://keyvhq.js.org/media/logo-sunset.svg" alt="keyv">](https://github.com/microlinkhq/keyv/packages/sqlite)

SQLite storage adapter for [Keyv](https://github.com/microlinkhq/keyv).

## Install

```shell
npm install --save @keyvhq/core @keyvhq/sqlite
```

## Usage

```js
const KeyvSqlite = require('@keyvhq/sqlite')
const Keyv = require('@keyvhq/core')

const keyv = new Keyv({
  store: new KeyvSqlite('sqlite://path/to/database.sqlite')
})
```

You can specify the `table` and [`busyTimeout`](https://sqlite.org/c3ref/busy_timeout.html) option:

```js
const KeyvSqlite = require('@keyvhq/sqlite')
const Keyv = require('@keyvhq/core')

const keyv = new Keyv({
  store: new KeyvSqlite('sqlite://path/to/database.sqlite', {
    table: 'cache',
    busyTimeout: 10000
  })
})
```

## License

**@keyvhq/sqlite** © [Luke Childs](https://lukechilds.co), released under the [MIT](https://github.com/microlinkhq/keyvhq/blob/master/LICENSE.md) License.<br/>
Maintained by [Microlink](https://microlink.io) with help from [contributors](https://github.com/microlinkhq/keyvhq/contributors).

> [microlink.io](https://microlink.io) · GitHub [microlinkhq](https://github.com/microlinkhq) · X [@microlinkhq](https://x.com/microlinkhq)