transfer-replitdb

0.0.3 • Public • Published

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

const Database = require("transfer-replitdb")
const db = new Database()

db.set("foo", "bar");

db.get("foo").then(console.log); // bar

Importing data from ReplitDB

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(() => {});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    1
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i transfer-replitdb

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

6.21 kB

Total Files

6

Last publish

Collaborators

  • remiixinc