Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gat-solutions/redis

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gat-solutions/redis

Custom IORedis for GAT

  • 1.0.7
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by9.09%
Maintainers
3
Weekly downloads
 
Created
Source

Custom IORedis GAT

Installation

$ npm install @gat-solutions/redis

Config Environment

//Host của redis write
REDIS_WRITE_HOST=
//Port của redis write
REDIS_WRITE_PORT=
//Password của redis write
REDIS_WRITE_PASSWORD=
//DB index của redis write
REDIS_WRITE_DB=

//Host của redis read
REDIS_READ_HOST=
//Port của redis read
REDIS_READ_PORT=
//Password của redis read
REDIS_READ_PASSWORD=
//DB index của redis read
REDIS_READ_DB=

Usage

import { RedisService } from "@gat-solutions/redis"

const redisService = new RedisService();

// Lưu data với thời gian 60s
redisService.set("KEY:ABC", "DEF", 60); //60s

// Lưu data vô thời hạn
redisService.setNx("KEY:ABC", "DEF"); //60s

// Lấy data từ redis
const data = await redisService.get("KEY:ABC");
if (!data){
    throw new Error("Not found data")
}
console.log(data) //"DEF"

// Xóa data
redisService.del("KEY:ABC")

// Lấy danh sách key
const keys = await redisService.keys("KEY")
console.log(keys) //["ABC"]

FAQs

Package last updated on 18 Dec 2023

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc