@eleven-am/pondsocket-express 0.0.30 → 0.0.31

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.
Files changed (3) hide show
  1. package/index.d.ts +3 -2
  2. package/index.js +3 -4
  3. package/package.json +10 -10
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Endpoint, PondPath, RequestHandler, ConnectionContext } from '@eleven-am/pondsocket/types';
1
+ import { ConnectionContext, Endpoint, PondPath, PondSocketOptions, RequestHandler } from '@eleven-am/pondsocket/types';
2
2
  import type { Express } from 'express';
3
3
  declare global {
4
4
  namespace Express {
@@ -29,7 +29,8 @@ interface PondSocketExpressApp extends Express {
29
29
  /**
30
30
  * @desc Creates a pond socket server
31
31
  * @param app - The Express app to be used by the server
32
+ * @param options - The options to be used by the pond socket server
32
33
  * @constructor
33
34
  */
34
- declare const pondSocket: (app: Express) => PondSocketExpressApp;
35
+ declare const pondSocket: (app: Express, options: Omit<PondSocketOptions, "server">) => PondSocketExpressApp;
35
36
  export default pondSocket;
package/index.js CHANGED
@@ -8,13 +8,12 @@ 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 options - The options to be used by the pond socket server
11
12
  * @constructor
12
13
  */
13
- const pondSocket = (app) => {
14
+ const pondSocket = (app, options) => {
14
15
  const server = (0, http_1.createServer)(app);
15
- const pondSocket = new pondsocket_1.default({
16
- server,
17
- });
16
+ const pondSocket = new pondsocket_1.default(Object.assign(Object.assign({}, options), { server }));
18
17
  app.createEndpoint = (path, handler) => pondSocket.createEndpoint(path, handler);
19
18
  app.listen = (...args) => pondSocket.listen(...args);
20
19
  return app;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eleven-am/pondsocket-express",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "PondSocket is a fast simple socket server",
5
5
  "keywords": [
6
6
  "socket",
@@ -26,26 +26,26 @@
26
26
  "lint:fix": "eslint --fix --ext .ts src",
27
27
  "copy": "cp package.json dist && cp README.md dist && cp LICENSE dist",
28
28
  "push": "npm version patch && npm run copy && cd dist && npm publish && cd ..",
29
- "pipeline": "npm run lint && npm run build && npm run push"
29
+ "pipeline": "npm run lint:fix && npm run lint && npm run build && npm run push"
30
30
  },
31
31
  "dependencies": {
32
- "@eleven-am/pondsocket": "^0.1.200"
32
+ "@eleven-am/pondsocket": "^0.1.202"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@eslint/compat": "^1.2.9",
36
36
  "@eslint/eslintrc": "^3.3.1",
37
- "@eslint/js": "^9.26.0",
38
- "@stylistic/eslint-plugin-ts": "^4.2.0",
39
- "@types/express": "^5.0.1",
37
+ "@eslint/js": "^9.28.0",
38
+ "@stylistic/eslint-plugin-ts": "^4.4.1",
39
+ "@types/express": "^5.0.3",
40
40
  "@types/jest": "^29.5.14",
41
- "@typescript-eslint/eslint-plugin": "^8.32.1",
42
- "eslint": "^9.26.0",
41
+ "@typescript-eslint/eslint-plugin": "^8.33.1",
42
+ "eslint": "^9.28.0",
43
43
  "eslint-plugin-file-progress": "^3.0.2",
44
44
  "eslint-plugin-import": "^2.31.0",
45
- "globals": "^16.1.0",
45
+ "globals": "^16.2.0",
46
46
  "jest": "^29.7.0",
47
47
  "prettier": "^3.5.3",
48
- "ts-jest": "^29.3.3",
48
+ "ts-jest": "^29.3.4",
49
49
  "ts-loader": "^9.5.2",
50
50
  "ts-node": "^10.9.2",
51
51
  "typescript": "^5.8.3"