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 - npm Package Compare versions

Comparing version 1.4.7 to 2.0.0

dist/index.d.ts

23

package.json
{
"name": "secure-store-redis",
"version": "1.4.7",
"description": "A simple wrapper to encrypt and decrypt data stored in redis",
"version": "2.0.0",
"description": "A simple wrapper to encrypt and decrypt data stored in Redis",
"license": "MIT",

@@ -20,11 +20,22 @@ "private": false,

},
"main": "./index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/",
"src/"
],
"scripts": {
"test": "node_modules/.bin/jaribu"
"test": "npm run build && jaribu",
"build": "tsc"
},
"dependencies": {
"redis-connection-pool": "^1.7.4"
"redis-connection-pool": "^2.0.1"
},
"devDependencies": {
"jaribu": "2.2.3"
"@types/eslint": "^8.4.1",
"@types/node": "^17.0.23",
"@typescript-eslint/parser": "^5.16.0",
"eslint": "^8.11.0",
"jaribu": "2.2.3",
"typescript": "^4.6.2"
},

@@ -31,0 +42,0 @@ "repository": {

# 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 outside of the process, without the key.
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`
```javascript
var SecureStore = require('secure-store-redis');
const SecureStore = require('secure-store-redis').default;
var store = new SecureStore({
namespace: 'myApp:store',
secret: '823HD8DG26JA0LK1239Hgb651TWfs0j1', // must be 32 char secret
errorOnNotFound: true, //optional; will cb error if data can't be found
redis: {
host: 'localhost', // optional
port: 6379, // optional
// optionally use the 'url' property to specify entire redis connect string
// url: 'redis://localhost:6379',
max_clients: 30, // optional
database: 0, // optional
options: {
auth_pass: 'password'
} //options for createClient of node-redis, optional
}
const store = new SecureStore('myApp:store', '823HD8DG26JA0LK1239Hgb651TWfs0j1', {
host: 'localhost', // optional
port: 6379, // optional
// optionally use the 'url' property to specify entire redis connect string
// url: 'redis://localhost:6379',
});
await store.init();
store.save('quote', 'i see dead people', function (err, reply) {
//...
store.get('quote', function (err, reply) {
// err: null
// reply: 'i see dead people'
});
store.get('quote', function (err, reply) {
// err: record not found
// reply: undefined
});
});
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
store.delete('quote', function (err, reply) {
// err: null
// reply: 1
});
await store.save('quote', 'i see dead people again');
var otherStore = new SecureStore({
prefix: 'myApp:store',
secret: 'this is the wrong secret',
redis: { // standard redis config object
host: "127.0.0.1",
port: 6379
}
const otherStore = new SecureStore('myApp:store', 'this is the wrong secret', {
host: "127.0.0.1",
port: 6379
});
await otherStore.init();
otherStore.get('quote', function (err, reply) {
// err: record not found
// reply: undefined
});
let res = await otherStore.get('quote');
// res: undefined
```
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