@eleven-am/pondsocket-express 0.0.11 → 0.0.13
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/index.d.ts +7 -1
- package/index.js +8 -2
- package/package.json +5 -5
package/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { ConnectionResponse, Endpoint, PondPath, IncomingConnection } from '@eleven-am/pondsocket/types';
|
|
2
2
|
import { Express } from 'express';
|
|
3
|
+
interface Options {
|
|
4
|
+
redisUrl?: string;
|
|
5
|
+
db?: number;
|
|
6
|
+
}
|
|
3
7
|
declare global {
|
|
4
8
|
namespace Express {
|
|
5
9
|
interface Application {
|
|
@@ -29,7 +33,9 @@ interface PondSocketExpressApp extends Express {
|
|
|
29
33
|
/**
|
|
30
34
|
* @desc Creates a pond socket server
|
|
31
35
|
* @param app - The Express app to be used by the server
|
|
36
|
+
* @param redisUrl - The redis url to be used by the server
|
|
37
|
+
* @param db - The db number to be used by the server
|
|
32
38
|
* @constructor
|
|
33
39
|
*/
|
|
34
|
-
declare const pondSocket: (app: Express) => PondSocketExpressApp;
|
|
40
|
+
declare const pondSocket: (app: Express, { redisUrl, db }?: Options) => PondSocketExpressApp;
|
|
35
41
|
export default pondSocket;
|
package/index.js
CHANGED
|
@@ -8,11 +8,17 @@ const pondsocket_1 = __importDefault(require("@eleven-am/pondsocket"));
|
|
|
8
8
|
/**
|
|
9
9
|
* @desc Creates a pond socket server
|
|
10
10
|
* @param app - The Express app to be used by the server
|
|
11
|
+
* @param redisUrl - The redis url to be used by the server
|
|
12
|
+
* @param db - The db number to be used by the server
|
|
11
13
|
* @constructor
|
|
12
14
|
*/
|
|
13
|
-
const pondSocket = (app) => {
|
|
15
|
+
const pondSocket = (app, { redisUrl, db } = {}) => {
|
|
14
16
|
const server = (0, http_1.createServer)(app);
|
|
15
|
-
const pondSocket = new pondsocket_1.default(
|
|
17
|
+
const pondSocket = new pondsocket_1.default({
|
|
18
|
+
server,
|
|
19
|
+
redisUrl,
|
|
20
|
+
db,
|
|
21
|
+
});
|
|
16
22
|
app.upgrade = (path, handler) => pondSocket.createEndpoint(path, handler);
|
|
17
23
|
app.listen = (...args) => pondSocket.listen(...args);
|
|
18
24
|
return app;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eleven-am/pondsocket-express",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "PondSocket is a fast simple socket server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"socket",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"pipeline": "npm run lint && npm run build && npm run push"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@eleven-am/pondsocket": "^0.1.
|
|
32
|
+
"@eleven-am/pondsocket": "^0.1.162"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/jest": "^29.5.12",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"eslint-plugin-file-progress": "^1.3.0",
|
|
39
39
|
"eslint-plugin-import": "^2.29.1",
|
|
40
40
|
"jest": "^29.7.0",
|
|
41
|
-
"prettier": "^3.2
|
|
42
|
-
"ts-jest": "^29.1.
|
|
41
|
+
"prettier": "^3.3.2",
|
|
42
|
+
"ts-jest": "^29.1.5",
|
|
43
43
|
"ts-loader": "^9.5.1",
|
|
44
44
|
"ts-node": "^10.9.2",
|
|
45
|
-
"typescript": "^5.
|
|
45
|
+
"typescript": "^5.5.3"
|
|
46
46
|
},
|
|
47
47
|
"jest": {
|
|
48
48
|
"moduleFileExtensions": [
|