# replitdb-client

> A simple client for repl.it db

Latest version **2.1.0** (published 2020-06-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install replitdb-client
pnpm add replitdb-client
yarn add replitdb-client
bun add replitdb-client
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2020-06-28 |
| First published | 2020-06-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Junhao Zhang |
| Maintainers | coder100 |
| Keywords | db |

## Links

- npm: https://www.npmjs.com/package/replitdb-client
- npm.io page: https://npm.io/package/replitdb-client

## Dependencies (1)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.0

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 2.1.0 (latest) — 2020-06-28
- 2.0.0 — 2020-06-26
- 1.3.0 — 2020-06-26
- 1.2.5 — 2020-06-26
- 1.2.4 — 2020-06-26
- 1.2.3 — 2020-06-26
- 1.2.2 — 2020-06-26
- 1.2.1 — 2020-06-26
- 1.2.0 — 2020-06-26
- 1.1.1 — 2020-06-26
- 1.0.1 — 2020-06-26
- 1.0.0 — 2020-06-26

## README

[![npm version](https://badge.fury.io/js/replitdb-client.svg)](https://badge.fury.io/js/replitdb-client)

[![Run on Repl.it](https://repl.it/badge/github/mrlapizgithub/repl.it-db)](https://repl.it/github/mrlapizgithub/repl.it-db)

# Repl.it DB Client
Repl.it-db client is a simple way to use the repl.it database. It uses `await/async`.

## Get started
```js
const Client = require("replitdb-client");
const client = new Client();
await Client.set("key", "value");
let key = await Client.get("key");
console.log(key);
```

## Docs
### `class Client(String key?)`
The key is the optional custom URL.

**Native Functions**

These functions are specified in the repl.it DB.

> `get(String key, Object options?)`

Gets a key. Returns Promise.
```js
Client.get("key", { raw: false }).then(console.log);
```

> `set(String key, Any value)`

Sets a key to value. Returns Client. 

> `delete(String key)`

Deletes a key. Returns Client.

> `list(String? prefix)`

Lists all of the keys, or all of the keys starting with `prefix` if specifed.

**Dynamic Functions**

These functions have been added by me.

> `empty()`

Clears the database. Returns Client

> `getAll()`

Get all key/value pairs and return as an object.

> `setAll(Object obj)`

Sets the entire database through a key/value object. Returns Client

> `deleteMultiple(...String args)`

Deletes multiple keys. Returns client.

## Tests
```sh
npm i
npm run test
```

---
_Source: https://npm.io/package/replitdb-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
