2.1.6 • Published 1 month ago

replit-storage v2.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

npm version

Run on Repl.it

Replit Storage

Replit Storage is a simple way to use the Replit Database in your repl.

Get started

const { Client } = require("replit-storage");
const client = new Client();

const key = 'str';

await client.set({
	key, // key: str
	[key]: key, // str: str
	other: 'value' // other: value
});

await client.get('key'); // str

Docs

Warning: Keys cannot start with the / symbol or have it repeated.

class Client(String url?)

The parameter url is an optional custom DB URL.

Functions

These are the methods which a client instance provides.

get(String key, Object config?)

Gets a value.

client.get("key", { raw: false });

set(Object entries)

Sets entries through an object.

delete(String key)

Deletes a key.

list(Object config?)

Lists all of the keys, or all of the keys starting with prefix if specifed.

client.list({ prefix: "" });

empty()

Clears the database.

getAll()

Get all key/value pairs and return as an object.

deleteMany(Array keys)

Deletes multiple keys.

Tests

npm i
npm run test
2.1.6

1 month ago

2.1.4

5 months ago

2.1.5

5 months ago

2.1.3

5 months ago

2.1.2

5 months ago

2.1.1

5 months ago

2.0.12

5 months ago

2.1.0

5 months ago

2.0.11

9 months ago

2.0.9

9 months ago

2.0.10

9 months ago

2.0.8

12 months ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago