@rampagecorp/redis

1.0.4 • Public • Published

RAMPAGE-Redis-NodeJS

Interact with Redis 7 on your RAMPAGE.Host server.

Rent a server today: https://rampagecloud.com/store/game-hosting

Code Example

const RedisClient = require("@rampagecorp/redis");
const redisHost = "region.shared.rampage.host";
const redisPort = 3000;
const redisPassword = process.env.redisPassword;
const redisClient = new RedisClient(redisHost, redisPort, redisPassword);

try {
  // Set a key-value pair
  redisClient.set("example_key", "example_value");

  // Get the value by key
  const value = await redisClient.get("example_key");
  console.log(`Value for 'example_key': ${value}`);

  // Delete a key
  redisClient.delete("example_key");

  // Close the connection
  redisClient.close();
} catch (error) {
  console.error(`Error: ${error.message}`);
}

Package Sidebar

Install

npm i @rampagecorp/redis

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

6.87 kB

Total Files

6

Last publish

Collaborators

  • vq9o