Socket
Book a DemoInstallSign in
Socket

replit-storage

Package Overview
Dependencies
Maintainers
0
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

replit-storage

Client for the Replit Database.

3.0.3
latest
Source
npmnpm
Version published
Weekly downloads
23
283.33%
Maintainers
0
Weekly downloads
 
Created
Source

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();

await client.set('key', `exampleValue`); // Sets `key` to `exampleValue`

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

Docs

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(String|Number key, any value)

Sets a single entry through a key-value pair.

setMany(Object entries)

Sets multiple key-value pairs 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

bun i
bun run test

FAQs

Package last updated on 02 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.