Socket
Socket
Sign inDemoInstall

machinepack-redis

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

machinepack-redis - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "machinepack-redis",
"version": "1.0.0",
"version": "1.0.1",
"description": "Structured Node.js bindings for Redis.",

@@ -5,0 +5,0 @@ "scripts": {

@@ -45,2 +45,3 @@

```javascript

@@ -53,19 +54,17 @@ /**

Redis.getConnection({
Redis.createManager({
connectionString: 'redis://127.0.0.1:6379',
}).exec({
error: function (err){
console.error('UNEXPECTED ERROR:',err);
},
malformed: function (report){
console.error('MALFORMED CONNECTION STRING:',report.error);
},
failedToConnect: function (report) {
console.error('FAILED TO CONNECT:',report.error);
},
success: function (report){
onUnexpectedFailure: function (err){ console.warn('WARNING: unexpected failure. Details:',err); }
}).exec(function (err, report) {
if (err) { console.error('UNEXPECTED ERROR:',err); return; }
var mgr = report.manager;
Pack.getConnection({
manager: mgr
}).exec(function (err, report) {
if (err) { console.error('UNEXPECTED ERROR:',err); return; }
console.log('CONNECTED!');
// Now you can use the connection however you like!
// Now you can use the redis client however you like!
//

@@ -98,10 +97,17 @@ // To use the connection:

// Always release the connection when finished:
Redis.releaseConnection({ connection: redisClient }).exec({
error: function (err){ console.error('UNEXPECTED ERROR:',err); },
success: function (report){ console.log('Connection released.'); }
});
});//</client.set
}
});//</Redis.getConnection>
// Release the connection when finished:
// (note that you can skip this step and just destroy the manager if you wish)
Redis.releaseConnection({ connection: redisClient }).exec(function(err) {
if (err) { console.error('UNEXPECTED ERROR:',err); return; }
console.log('Connection released.');
// But ALWAYS destroy the connection manager when finished
Redis.destroyManager({ manager: mgr }).exec(function(err) {
if (err) { console.error('UNEXPECTED ERROR:',err); return; }
console.log('Done. (Manager destroyed)');
});//</Redis.destroyManager>
});//</Redis.releaseConnection>
});//</client.set>
});//</Redis.getConnection>
});//</Redis.createManager>
```

@@ -108,0 +114,0 @@

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