# replitdb

> ReplitDB is an easy-to-use and enhanced client for Replit databases.

Latest version **1.0.0-beta** (published 2022-07-06) · CC-BY-SA-4.0 license · 3 weekly downloads

## Install

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

## 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 | 1.0.0-beta |
| Published | 2022-07-06 |
| First published | 2022-02-14 |
| Weekly downloads | 3 |
| License | CC-BY-SA-4.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.4 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Rivest Osz |
| Maintainers | rivestoss |
| Keywords | replit, database, replit-database |

## Links

- npm: https://www.npmjs.com/package/replitdb
- Repository: https://github.com/rivest-oss/repldb
- Homepage: https://github.com/rivest-oss/repldb#readme
- Issues: https://github.com/rivest-oss/repldb/issues
- npm.io page: https://npm.io/package/replitdb

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.26.0

## Recent versions

- 1.0.0-beta (latest) — 2022-07-06
- 0.1.0-alpha — 2022-02-14

## README

## About
`replitdb` is a simple to use and enhanced client for Replit databases.

## Installation
**How to install it?**

```sh-session
npm install replitdb
```

## Examples of use:

Initialise the database:
```js
const ReplDB = require(`replitdb`),
	repldb = new ReplDB();
```

Get a document:
```js
repldb.get('document name').then(res => {
	console.log(`Value:`, res);
}).catch(err => {
	// Catch error
});
```

Set a document:
```js
repldb.set('document name', 'document value').then(() => {
	console.log('Document added!');
}).catch(err => {
	// Catch error
});
```

Delete a document:
```js
repldb.delete('document name').then(() => {
	console.log('Document deleted!');
}).catch(err => {
	// Catch error
});
```

List all documents names with certain prefix:
```js
repldb.list('user_').then(keys => {
	console.log('Documents:', keys);
}).catch(err => {
	// Catch error
});
```

Get all documents with certain prefix:
```js
repldb.getAll('user_').then(users => {
	console.log('Users:', users);
}).catch(err => {
	// Catch error
});
```

Add an element to an array of a certain document:
```js
repldb.update('user_86068052', {
	$add: {
		badges: 64,
	},
}).then(() => {
	console.log('Updated array!');
}).catch(err => {
	// Catch error
});
```


## Support

If you don't understand something, are experiencing problems or just need to be guided, feel free to join [our Discord server](https://discord.com/invite/p6v6VSDSpW).

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