redis-memory-server 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -95,6 +95,14 @@ redisServer.getInstanceInfo();
95
95
  // when your script exits, a special process killer will shut it down for you
96
96
  ```
97
97
 
98
+ ### Start server via npx
99
+
100
+ ```bash
101
+ npx redis-memory-server
102
+ # OR
103
+ REDISMS_PORT=6379 npx redis-memory-server
104
+ ```
105
+
98
106
  ### Available options for RedisMemoryServer
99
107
 
100
108
  All settings are optional.
@@ -177,6 +185,7 @@ or
177
185
  }
178
186
  ```
179
187
 
188
+
180
189
  ## Credits
181
190
 
182
191
  This package is inspired heavily by [mongodb-memory-server](https://npmjs.com/package/mongodb-memory-server).
package/bin/index.js ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+
3
+ /* eslint @typescript-eslint/no-var-requires: 0 */
4
+
5
+ const RedisMemoryServer = require('../lib/index.js').default;
6
+
7
+ (async () => {
8
+ const server = new RedisMemoryServer({
9
+ instance: {
10
+ port: process.env.REDISMS_PORT ? parseInt(process.env.REDISMS_PORT, 10) : undefined,
11
+ },
12
+ });
13
+
14
+ const host = await server.getHost();
15
+ const port = await server.getPort();
16
+
17
+ console.log(`Redis server running at: ${host}:${port}`);
18
+ })().catch((error) => {
19
+ console.error(error);
20
+ process.exit(1);
21
+ });
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "redis-memory-server",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Redis Server for testing. The server will allow you to connect your favorite client library to the Redis Server and run parallel integration tests isolated from each other.",
5
- "main": "lib/index",
5
+ "bin": "bin/index.js",
6
+ "main": "lib/index.js",
6
7
  "types": "lib/index.d.ts",
7
8
  "repository": {
8
9
  "type": "git",
@@ -97,5 +98,5 @@
97
98
  "test:watch": "yarn watch",
98
99
  "tscheck": "tsc --noEmit"
99
100
  },
100
- "packageManager": "yarn@3.6.1"
101
+ "packageManager": "yarn@4.0.0"
101
102
  }