https://github.com/remiixinc/transfer-replitdb
♻️ Transfer your ReplitDB data without completely rewriting your app when moving a project to a different hosting platform.
https://github.com/remiixinc/transfer-replitdb
database db javascript json nodejs npm repldb replit replitdb
Last synced: 12 months ago
JSON representation
♻️ Transfer your ReplitDB data without completely rewriting your app when moving a project to a different hosting platform.
- Host: GitHub
- URL: https://github.com/remiixinc/transfer-replitdb
- Owner: RemiixInc
- License: mit
- Created: 2021-04-06T08:39:35.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-06T10:07:47.000Z (about 5 years ago)
- Last Synced: 2025-05-12T03:15:19.918Z (12 months ago)
- Topics: database, db, javascript, json, nodejs, npm, repldb, replit, replitdb
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/transfer-replitdb
- Size: 4.88 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# transfer-replitdb
A node.js module that allows you to effortlessly transfer your ReplitDB data without completely rewriting your app when moving a project to a different hosting platform.
## Example
```js
const Database = require("transfer-replitdb")
const db = new Database()
db.set("foo", "bar");
db.get("foo").then(console.log); // bar
```
## Importing data from ReplitDB
```js
db.import("ReplitDB URL")
// Get your ReplitDB url by running `echo $REPLIT_DB_URL` in your old Repl's terminal.
```
## Commands
**Import** the database
``const Database = require("transfer-replitdb")``
**Create** a new database
``const db = new Database()``
**Set** a key to a value
``db.set("key", "value").then(() => {});``
**Get** a key's value
``db.get("key").then(value => {});``
**Delete** a key
``db.delete("key").then(() => {});``
**List** all keys
``db.list().then(keys => {});``
**List** all keys with a prefix
``db.list("prefix").then(matches => {});``
**Empty** the database
``db.empty().then(() => {});``
**Get all** keys and values
``db.getAll().then(all => {});``
**Set all** keys in the database
``db.setAll({ "key": "value" }).then(all => {});``
**Delete multiple** keys
``db.deleteMultiple([ "key1", "key2" ]).then(() => {});``