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

secure-store-redis

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

secure-store-redis

A simple wrapper to encrypt and decrypt data stored in Redis

  • 3.0.0-rc.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24
decreased by-45.45%
Maintainers
1
Weekly downloads
 
Created
Source

secure-store-redis

A simple wrapper to encrypt and decrypt data stored in redis. The main point is to ensure that any data you store in redis cannot be accessed by anyone else, without the key.

NOTE version 2.x is a rewrite in TypeScript, using async functions, and is backwards incompatible with 1.x

const SecureStore = require("secure-store-redis").default;

const store = new SecureStore(
  "myApp:store",
  "823HD8DG26JA0LK1239Hgb651TWfs0j1",
  {
    redis: {
      host: "localhost",
      port: 6379, // optional
      // optionally use the 'url' property to specify entire redis connect string
      // url: 'redis://localhost:6379',
    }, // optional
  }
);
await store.init();

await store.save("quote", "i see dead people");
let res = await store.get("quote");
// res: 'i see dead people'
let res = await store.get("quote");
// res: null
const num = await store.delete("quote");
// num: 1

await store.save("quote", "i see dead people again");

const otherStore = new SecureStore("myApp:store", "this is the wrong secret", {
  host: "127.0.0.1",
  port: 6379,
});
await otherStore.init();

let res = await otherStore.get("quote");
// res: undefined

Keywords

FAQs

Package last updated on 08 May 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