New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

easy-redis

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-redis - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

7

index.js

@@ -11,9 +11,10 @@ 'use strict'

function EasyRedis() {
function EasyRedis(filePath) {
if (!(this instanceof EasyRedis)) {
return new EasyRedis();
return new EasyRedis(filePath);
}
init(filePath);
}
EasyRedis.prototype.init = function (filePath) {
function init (filePath) {
let exists = fs.existsSync(filePath);

@@ -20,0 +21,0 @@ if (exists) {

{
"name": "easy-redis",
"version": "0.1.0",
"version": "0.2.0",
"description": "Just write a config file,you can get one of redis connection with different topic",

@@ -5,0 +5,0 @@ "main": "index.js",

'use strict'
const redis = require('../index')();
const redis = require('../index')(`${__dirname}/redisConfig.json`);
const should = require('chai').should()
describe('index', function () {
it('init', function () {
redis.init(`${__dirname}/redisConfig.json`).should.equal(true);
})
it('getConnect', function () {
//need start local redis server
redis.init(`${__dirname}/redisConfig.json`);
redis.getConnect('localhost').should.be.a('object');

@@ -16,3 +12,2 @@ })

//need start local redis server
redis.init(`${__dirname}/redisConfig.json`)
redis.getConnect('localhost').setAsync('test', 'oops').then((result) => {

@@ -19,0 +14,0 @@ result.should.equal('OK');

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