Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
tests/node_modules
21 changes: 0 additions & 21 deletions .semaphore/semaphore.yml

This file was deleted.

25 changes: 25 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
MIT License

Copyright (c) 2021 Piero Maddaleni

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---
The following license is carried over from the original source code:

MIT License

Copyright (c) 2020 Repl.it

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
[![npm version](https://badge.fury.io/js/%40replit%2Fdatabase.svg)](https://badge.fury.io/js/%40replit%2Fdatabase)
[![npm version](https://badge.fury.io/js/better-replit-db.svg)](https://badge.fury.io/js/better-replit-db)

[![Run on Repl.it](https://repl.it/badge/github/replit/database-node)](https://repl.it/github/replit/database-node)
[![Run on Repl.it](https://replit.com/badge/github/pieromqwerty/better-replit-db)](https://replit.com/github/pieromqwerty/better-replit-db)

# Repl.it Database client
Repl.it Database client is a simple way to use Repl.it Database in your Node.js repls. It uses `await/async`.
# Better Replit DB
Better Replit DB is a fork of the official Replit Database client, with the added benefit of the contents being cached in memory. This allows for much faster load read and write times than the regular client. It also uses `await/async`, just like the official client.

*Better Replit DB is a drop-in replacement as well, simply change `require('@replit/database')` to `require('better-replit-db')` in your JS file.*

***IT IS LITERALLY DOZENS OF TIMES FASTER THAN THE OFFICIAL LIB***

## Speed Comparison
### 20x Ops
|Test|better-replit-database|@replit/database|Times Faser
-|-|-|-
Creating a Client|**16 ms**</span>|120 ms|**7.5x**
Setting a Value|**80 ms**|2858 ms|**35.7x**
Listing Keys|**107 ms**|1583 ms|**14.8x**
Getting a Value|**25 ms**|1349 ms|**54.0x**
Deleting a Value|**199 ms**|4046 ms|**20.3x**
Listing Keys|**36 ms**|1422 ms|**39.5x**
Ensuring Values are Escaped|**35 ms**|1350ms|**38.6x**

### 100x Ops
> Coming Soon - Regular DB Host Gets Ratelimited

## Get started
```js
const Client = require("@replit/database");
const client = new Client();
await Client.set("key", "value");
let key = await Client.get("key");
const database = require("better-replit-db");
const db = new database();
await db.set("key", "value");
let key = await db.get("key");
console.log(key);
```

Expand Down Expand Up @@ -43,7 +62,7 @@ Lists all of the keys, or all of the keys starting with `prefix` if specifed.

**Dynamic Functions**

These functions have been added by me.
These functions have been added by the original author.

> `empty()`

Expand Down
Loading