Skip to content

Commit 88fe8e8

Browse files
committed
Updated readme and dependency version.
1 parent 2a5ecaf commit 88fe8e8

2 files changed

Lines changed: 37 additions & 14 deletions

File tree

README.md

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@ Cache
66
[npm]: https://www.npmjs.com/package/@plgworks/cache
77

88
Cache is the central cache implementation for several modules.
9-
109
It contains three caching engines. The decision of which caching engine to use is governed while creating the cache object.
1110
The caching engines implemented are:
1211

13-
* Memcached
14-
* Redis
15-
* In-process (use with single threaded process in development mode only)
12+
* [Memcached](https://memcached.org/)
13+
* [Redis](https://redis.io/docs/)
14+
* In-memory (use with single threaded process in development mode only)
15+
16+
# Install NPM
17+
```bash
18+
npm install @plgworks/cache --save
19+
```
1620

17-
##### Constructor parameters:
21+
# Initialize
1822
There is 1 parameter required while creating the cache implementer.
1923

2024
* First parameter is mandatory and it specifies the configuration strategy to be used. An example of the configStrategy is:
@@ -67,14 +71,7 @@ configStrategy = {
6771
consistentBehavior: "1"
6872
}
6973
}
70-
````
71-
72-
# Install
73-
74-
```bash
75-
npm install @plgworks/cache --save
7674
```
77-
7875
# Examples:
7976

8077
#### Create Cache Object:
@@ -185,3 +182,29 @@ cacheImplementer.touch('testKey', 10).then(function(cacheResponse){
185182
}
186183
});
187184
```
185+
### Running test cases
186+
##### Set environment variables of particular cache engine for which you want to run the tests.
187+
````
188+
# For Memcached
189+
source test/env/memcached.sh
190+
191+
# For Redis
192+
source test/env/redis.sh
193+
194+
# For In-memory
195+
source test/env/inMemory.sh
196+
````
197+
##### Cache engines must be running on the specified ports.
198+
199+
* Memcached (11212,11213,11214,11215)
200+
````
201+
memcached -p 11212 -d
202+
````
203+
* Redis (6380,6381)
204+
````
205+
redis-server --port 6380
206+
````
207+
##### Run tests
208+
````
209+
./node_modules/.bin/mocha --recursive "./test/*.js"
210+
````

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
"@plgworks/base": "^1.0.0"
3131
},
3232
"devDependencies": {
33-
"eslint": "6.5.1",
3433
"chai": "4.3.0",
34+
"eslint": "6.5.1",
3535
"ink-docstrap": "1.3.2",
3636
"lint-staged": "8.0.3",
37-
"mocha": "5.2.0",
37+
"mocha": "^8.4.0",
3838
"pre-commit": "1.2.2",
3939
"prettier": "1.14.3"
4040
},

0 commit comments

Comments
 (0)