node-pluginsmanager 2.5.1 → 3.0.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/LICENSE CHANGED
@@ -1,13 +1,13 @@
1
- Copyright (c) 2023, Sébastien Vidal
2
-
3
- Permission to use, copy, modify, and/or distribute this software for any
4
- purpose with or without fee is hereby granted, provided that the above
5
- copyright notice and this permission notice appear in all copies.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1
+ Copyright (c) 2023, Sébastien Vidal
2
+
3
+ Permission to use, copy, modify, and/or distribute this software for any
4
+ purpose with or without fee is hereby granted, provided that the above
5
+ copyright notice and this permission notice appear in all copies.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md CHANGED
@@ -1,79 +1,84 @@
1
- # node-pluginsmanager
2
- A plugins manager
3
-
4
- [![Build status](https://api.travis-ci.org/Psychopoulet/node-pluginsmanager.svg?branch=master)](https://travis-ci.org/Psychopoulet/node-pluginsmanager)
5
- [![Coverage status](https://coveralls.io/repos/github/Psychopoulet/node-pluginsmanager/badge.svg?branch=master)](https://coveralls.io/github/Psychopoulet/node-pluginsmanager)
6
- [![Dependency status](https://david-dm.org/Psychopoulet/node-pluginsmanager/status.svg)](https://david-dm.org/Psychopoulet/node-pluginsmanager)
7
- [![Dev dependency status](https://david-dm.org/Psychopoulet/node-pluginsmanager/dev-status.svg)](https://david-dm.org/Psychopoulet/node-pluginsmanager?type=dev)
8
- [![Issues](https://img.shields.io/github/issues/Psychopoulet/node-pluginsmanager.svg)](https://github.com/Psychopoulet/node-pluginsmanager/issues)
9
- [![Pull requests](https://img.shields.io/github/issues-pr/Psychopoulet/node-pluginsmanager.svg)](https://github.com/Psychopoulet/node-pluginsmanager/pulls)
10
-
11
- > please note that this version is only usable with node-pluginsmanager-plugin 3.x.x && 4.x.x
12
-
13
- ## Installation
14
-
15
- ```bash
16
- $ npm install node-pluginsmanager
17
- ```
18
-
19
- ## Features
20
-
21
- * simply manage plugins (extended from [node-pluginsmanager-plugin](https://github.com/Psychopoulet/node-pluginsmanager-plugin)) to interact with specifics hardwares / API / whatever
22
- * install plugins manually or via github & initialize them
23
- * update plugins via github
24
- * uninstall plugins and release there resources
25
- * run plugins' middlewares for server, to create specifics rules
26
- * check plugins' modules' versions
27
-
28
- ## Architecture
29
-
30
- ### Plugin
31
-
32
- ![Plugin](https://raw.githubusercontent.com/Psychopoulet/node-pluginsmanager-plugin/master/documentation/pictures/functional.jpg)
33
-
34
- ### Routes
35
-
36
- ![Routes](./documentation/routes.jpg)
37
-
38
- ## Content
39
-
40
- [check the TypeScript definition file](https://github.com/Psychopoulet/node-pluginsmanager/blob/master/lib/index.d.ts)
41
-
42
- ## Events
43
-
44
- * ``` on("error", (err: Error) => void) : this ``` fires if an error occurs
45
-
46
- * ``` on("loading", (plugin: Orchestrator, data?: any) => void) : this ``` fires if a plugin starts load
47
- * ``` on("loaded", (plugin: Orchestrator, data?: any) => void) : this ``` fires if a plugin ends load
48
- * ``` on("allloaded", (data?: any) => void) : this ``` fires if all the plugins are loaded
49
-
50
- * ``` on("initializing", (plugin: Orchestrator, data?: any) => void) : this ``` fires if a plugin starts init
51
- * ``` on("initialized", (plugin: Orchestrator, data?: any) => void) : this ``` fires if a plugin ends init
52
- * ``` on("allinitialized", (data?: any) => void) : this ``` fires if all the plugins are initialized
53
-
54
- * ``` on("released", (plugin: Orchestrator, data?: any) => void) : this ``` fires if a plugin is released
55
- * ``` on("allreleased", (data?: any) => void) : this ``` fires if all the plugins are released
56
-
57
- * ``` on("destroyed", (pluginName: string, data?: any) => void) : this ``` fires if a plugin is destroyed
58
- * ``` on("alldestroyed", (data?: any) => void) : this ``` fires if all the plugins are destroyed
59
-
60
- * ``` on("installed", (pluginName: string, data?: any) => void) : this ``` fires if a plugin is installed
61
- * ``` on("updated", (plugin: Orchestrator, data?: any) => void) : this ``` fires if a plugin is updated
62
- * ``` on("uninstalled", (pluginName: string, data?: any) => void) : this ``` fires if a plugin is uninstalled
63
-
64
- ## Examples
65
-
66
- [check the TypeScript compilation tests](https://github.com/Psychopoulet/node-pluginsmanager/blob/master/test/typescript/compilation.ts)
67
-
68
- ## Tests
69
-
70
- ```bash
71
- $ git clone git://github.com/Psychopoulet/node-pluginsmanager.git
72
- $ cd ./node-pluginsmanager
73
- $ npm install
74
- $ npm run-script tests
75
- ```
76
-
77
- ## License
78
-
79
- [ISC](LICENSE)
1
+ # node-pluginsmanager
2
+ A plugins manager
3
+
4
+ [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=Psychopoulet_node-pluginsmanager&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=Psychopoulet_node-pluginsmanager)
5
+ [![Issues](https://img.shields.io/github/issues/Psychopoulet/node-pluginsmanager.svg)](https://github.com/Psychopoulet/node-pluginsmanager/issues)
6
+ [![Pull requests](https://img.shields.io/github/issues-pr/Psychopoulet/node-pluginsmanager.svg)](https://github.com/Psychopoulet/node-pluginsmanager/pulls)
7
+
8
+ [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=Psychopoulet_node-pluginsmanager&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=Psychopoulet_node-pluginsmanager)
9
+ [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=Psychopoulet_node-pluginsmanager&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=Psychopoulet_node-pluginsmanager)
10
+ [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Psychopoulet_node-pluginsmanager&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=Psychopoulet_node-pluginsmanager)
11
+ [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=Psychopoulet_node-pluginsmanager&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=Psychopoulet_node-pluginsmanager)
12
+ [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=Psychopoulet_node-pluginsmanager&metric=bugs)](https://sonarcloud.io/summary/new_code?id=Psychopoulet_node-pluginsmanager)
13
+
14
+ [![Known Vulnerabilities](https://snyk.io/test/github/Psychopoulet/node-pluginsmanager/badge.svg)](https://snyk.io/test/github/Psychopoulet/node-pluginsmanager)
15
+
16
+ > please note that this version is only usable with node-pluginsmanager-plugin 3.x.x && 4.x.x
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ $ npm install node-pluginsmanager
22
+ ```
23
+
24
+ ## Features
25
+
26
+ * simply manage plugins (extended from [node-pluginsmanager-plugin](https://github.com/Psychopoulet/node-pluginsmanager-plugin)) to interact with specifics hardwares / API / whatever
27
+ * install plugins manually or via github & initialize them
28
+ * update plugins via github
29
+ * uninstall plugins and release there resources
30
+ * run plugins' middlewares for server, to create specifics rules
31
+ * check plugins' modules' versions
32
+
33
+ ## Architecture
34
+
35
+ ### Plugin
36
+
37
+ ![Plugin](https://raw.githubusercontent.com/Psychopoulet/node-pluginsmanager-plugin/master/documentation/pictures/functional.jpg)
38
+
39
+ ### Routes
40
+
41
+ ![Routes](./documentation/routes.jpg)
42
+
43
+ ## Content
44
+
45
+ [check the TypeScript definition file](https://github.com/Psychopoulet/node-pluginsmanager/blob/master/lib/index.d.ts)
46
+
47
+ ## Events
48
+
49
+ * ``` on("error", (err: Error) => void) : this ``` fires if an error occurs
50
+
51
+ * ``` on("loading", (plugin: Orchestrator, data?: any) => void) : this ``` fires if a plugin starts load
52
+ * ``` on("loaded", (plugin: Orchestrator, data?: any) => void) : this ``` fires if a plugin ends load
53
+ * ``` on("allloaded", (data?: any) => void) : this ``` fires if all the plugins are loaded
54
+
55
+ * ``` on("initializing", (plugin: Orchestrator, data?: any) => void) : this ``` fires if a plugin starts init
56
+ * ``` on("initialized", (plugin: Orchestrator, data?: any) => void) : this ``` fires if a plugin ends init
57
+ * ``` on("allinitialized", (data?: any) => void) : this ``` fires if all the plugins are initialized
58
+
59
+ * ``` on("released", (plugin: Orchestrator, data?: any) => void) : this ``` fires if a plugin is released
60
+ * ``` on("allreleased", (data?: any) => void) : this ``` fires if all the plugins are released
61
+
62
+ * ``` on("destroyed", (pluginName: string, data?: any) => void) : this ``` fires if a plugin is destroyed
63
+ * ``` on("alldestroyed", (data?: any) => void) : this ``` fires if all the plugins are destroyed
64
+
65
+ * ``` on("installed", (pluginName: string, data?: any) => void) : this ``` fires if a plugin is installed
66
+ * ``` on("updated", (plugin: Orchestrator, data?: any) => void) : this ``` fires if a plugin is updated
67
+ * ``` on("uninstalled", (pluginName: string, data?: any) => void) : this ``` fires if a plugin is uninstalled
68
+
69
+ ## Examples
70
+
71
+ [check the TypeScript compilation tests](https://github.com/Psychopoulet/node-pluginsmanager/blob/master/test/typescript/compilation.ts)
72
+
73
+ ## Tests
74
+
75
+ ```bash
76
+ $ git clone git://github.com/Psychopoulet/node-pluginsmanager.git
77
+ $ cd ./node-pluginsmanager
78
+ $ npm install
79
+ $ npm run-script tests
80
+ ```
81
+
82
+ ## License
83
+
84
+ [ISC](LICENSE)
@@ -5,19 +5,19 @@ import type { Server as WebSocketServer } from "ws";
5
5
  import type { Server as SocketIOServer } from "socket.io";
6
6
  interface iPluginManagerOptions {
7
7
  "directory"?: string;
8
- "externalRessourcesDirectory"?: string;
8
+ "externalResourcesDirectory"?: string;
9
9
  "logger"?: tLogger | null;
10
10
  }
11
- type tBeforeAllMethodCallback = (...data: any) => Promise<void> | void;
11
+ type tBeforeAllMethodCallback = (...data: unknown[]) => Promise<void> | void;
12
12
  export default class PluginsManager extends EventEmitter {
13
13
  protected _beforeLoadAll: tBeforeAllMethodCallback | null;
14
14
  protected _beforeInitAll: tBeforeAllMethodCallback | null;
15
15
  protected _logger: tLogger | null;
16
16
  protected _orderedPluginsNames: string[];
17
17
  directory: string;
18
- externalRessourcesDirectory: string;
18
+ externalResourcesDirectory: string;
19
19
  plugins: Orchestrator[];
20
- constructor(options: iPluginManagerOptions);
20
+ constructor(options?: iPluginManagerOptions);
21
21
  getPluginsNames(): string[];
22
22
  setOrder(pluginsNames: string[]): Promise<void>;
23
23
  getOrder(): string[];
@@ -26,13 +26,13 @@ export default class PluginsManager extends EventEmitter {
26
26
  appMiddleware(req: IncomingMessage, res: ServerResponse, next: () => void): void;
27
27
  socketMiddleware(server: WebSocketServer | SocketIOServer): void;
28
28
  beforeLoadAll(callback: tBeforeAllMethodCallback): Promise<void>;
29
- loadAll(...data: any): Promise<void>;
30
- destroyAll(...data: any): Promise<void>;
29
+ loadAll(...data: unknown[]): Promise<void>;
30
+ destroyAll(...data: unknown[]): Promise<void>;
31
31
  beforeInitAll(callback: tBeforeAllMethodCallback): Promise<void>;
32
- initAll(...data: any): Promise<void>;
33
- releaseAll(...data: any): Promise<void>;
34
- installViaGithub(user: string, repo: string, ...data: any): Promise<Orchestrator>;
35
- updateViaGithub(plugin: Orchestrator, ...data: any): Promise<Orchestrator>;
36
- uninstall(plugin: Orchestrator, ...data: any): Promise<string>;
32
+ initAll(...data: unknown[]): Promise<void>;
33
+ releaseAll(...data: unknown[]): Promise<void>;
34
+ installViaGithub(user: string, repo: string, ...data: unknown[]): Promise<Orchestrator>;
35
+ updateViaGithub(plugin: Orchestrator, ...data: unknown[]): Promise<Orchestrator>;
36
+ uninstall(plugin: Orchestrator, ...data: unknown[]): Promise<string>;
37
37
  }
38
38
  export {};
@@ -30,31 +30,39 @@ const npmInstall_1 = __importDefault(require("./cmd/npm/npmInstall"));
30
30
  const npmUpdate_1 = __importDefault(require("./cmd/npm/npmUpdate"));
31
31
  // consts
32
32
  const DEFAULT_PLUGINS_DIRECTORY = (0, node_path_1.join)((0, node_os_1.homedir)(), "node-pluginsmanager-plugins");
33
- const DEFAULT_RESSOURCES_DIRECTORY = (0, node_path_1.join)((0, node_os_1.homedir)(), "node-pluginsmanager-resources");
33
+ const DEFAULT_RESOURCES_DIRECTORY = (0, node_path_1.join)((0, node_os_1.homedir)(), "node-pluginsmanager-resources");
34
34
  // module
35
35
  class PluginsManager extends node_events_1.default {
36
+ // attributes
37
+ // protected
38
+ _beforeLoadAll;
39
+ _beforeInitAll;
40
+ _logger;
41
+ _orderedPluginsNames;
42
+ // public
43
+ directory; // plugins location (must be writable). default : join(homedir(), "node-pluginsmanager-plugins")
44
+ externalResourcesDirectory; // external resources locations (sqlite, files, cache, etc...) (must be writable). default : join(homedir(), "node-pluginsmanager-resources")
45
+ plugins; // plugins' Orchestrators
36
46
  // constructor
37
- constructor(options) {
47
+ constructor(options = {}) {
38
48
  super();
49
+ // mandatory props
50
+ if ("object" !== typeof options) {
51
+ throw new ReferenceError("\"options\" must be a non-null object");
52
+ }
39
53
  // protected
40
54
  this._beforeLoadAll = null;
41
55
  this._beforeInitAll = null;
42
56
  this._orderedPluginsNames = [];
43
- this._logger = options && "function" === typeof options.logger
44
- ? options.logger
45
- : null;
57
+ this._logger = "function" === typeof options.logger ? options.logger : null;
46
58
  // public
47
59
  this.plugins = [];
48
- this.directory = options && "undefined" !== typeof options.directory
49
- ? options.directory
50
- : DEFAULT_PLUGINS_DIRECTORY;
51
- this.externalRessourcesDirectory = options && "undefined" !== typeof options.externalRessourcesDirectory
52
- ? options.externalRessourcesDirectory
53
- : DEFAULT_RESSOURCES_DIRECTORY;
60
+ this.directory = options.directory ?? DEFAULT_PLUGINS_DIRECTORY;
61
+ this.externalResourcesDirectory = options.externalResourcesDirectory ?? DEFAULT_RESOURCES_DIRECTORY;
54
62
  }
55
63
  // public
56
64
  getPluginsNames() {
57
- return [...this.plugins].map((plugin) => {
65
+ return this.plugins.map((plugin) => {
58
66
  return plugin.name;
59
67
  });
60
68
  }
@@ -78,19 +86,17 @@ class PluginsManager extends node_events_1.default {
78
86
  return !errors.length ? Promise.resolve() : Promise.reject(new Error(errors.join("\r\n")));
79
87
  }).then(() => {
80
88
  this._orderedPluginsNames = pluginsNames;
81
- return Promise.resolve();
82
89
  });
83
90
  }
84
91
  getOrder() {
85
92
  return [...this._orderedPluginsNames];
86
93
  }
87
94
  checkAllModules() {
88
- const _checkPluginsModules = (i = 0) => {
89
- return i < this.plugins.length ? this.checkModules(this.plugins[i]).then(() => {
90
- return _checkPluginsModules(i + 1);
91
- }) : Promise.resolve();
92
- };
93
- return _checkPluginsModules();
95
+ return Promise.all(this.plugins.map((plugin) => {
96
+ return this.checkModules(plugin);
97
+ })).then(() => {
98
+ return Promise.resolve();
99
+ });
94
100
  }
95
101
  checkModules(plugin) {
96
102
  return (0, checkAbsoluteDirectory_1.default)("checkModules/directory", this.directory).then(() => {
@@ -116,7 +122,7 @@ class PluginsManager extends node_events_1.default {
116
122
  return next();
117
123
  }
118
124
  else {
119
- const _recursiveNext = (i) => {
125
+ function _recursiveNext(i) {
120
126
  if (i < plugins.length) {
121
127
  return () => {
122
128
  return plugins[i].appMiddleware(req, res, _recursiveNext(i + 1));
@@ -126,8 +132,8 @@ class PluginsManager extends node_events_1.default {
126
132
  else {
127
133
  return next;
128
134
  }
129
- };
130
- return plugins[0].appMiddleware(req, res, _recursiveNext(0));
135
+ }
136
+ return plugins[0].appMiddleware(req, res, _recursiveNext(1)); // must start at index "1", cause the "0" is executed here
131
137
  }
132
138
  }
133
139
  // middleware for socket to add bilateral push events
@@ -142,7 +148,6 @@ class PluginsManager extends node_events_1.default {
142
148
  beforeLoadAll(callback) {
143
149
  return (0, checkFunction_1.default)("beforeLoadAll/callback", callback).then(() => {
144
150
  this._beforeLoadAll = callback;
145
- return Promise.resolve();
146
151
  });
147
152
  }
148
153
  // load all plugins asynchronously, using "data" in arguments for "load" plugin's Orchestrator method
@@ -156,11 +161,11 @@ class PluginsManager extends node_events_1.default {
156
161
  });
157
162
  // create dir if not exist
158
163
  }).then(() => {
159
- return (0, checkNonEmptyString_1.default)("initAll/externalRessourcesDirectory", this.externalRessourcesDirectory).then(() => {
160
- return (0, promises_1.mkdir)(this.externalRessourcesDirectory, {
164
+ return (0, checkNonEmptyString_1.default)("initAll/externalResourcesDirectory", this.externalResourcesDirectory).then(() => {
165
+ return (0, promises_1.mkdir)(this.externalResourcesDirectory, {
161
166
  "recursive": true
162
167
  }).then(() => {
163
- return (0, checkAbsoluteDirectory_1.default)("initAll/externalRessourcesDirectory", this.externalRessourcesDirectory);
168
+ return (0, checkAbsoluteDirectory_1.default)("initAll/externalResourcesDirectory", this.externalResourcesDirectory);
164
169
  });
165
170
  });
166
171
  // ensure loop
@@ -184,7 +189,7 @@ class PluginsManager extends node_events_1.default {
184
189
  return (0, promises_1.readdir)(this.directory);
185
190
  // load all
186
191
  }).then((files) => {
187
- return (0, loadSortedPlugins_1.default)(this.directory, this.externalRessourcesDirectory, files, this.plugins, this._orderedPluginsNames, this.emit.bind(this), this._logger, ...data);
192
+ return (0, loadSortedPlugins_1.default)(this.directory, this.externalResourcesDirectory, files, this.plugins, this._orderedPluginsNames, this.emit.bind(this), this._logger, ...data);
188
193
  // sort plugins
189
194
  }).then(() => {
190
195
  this.plugins.sort((a, b) => {
@@ -198,51 +203,35 @@ class PluginsManager extends node_events_1.default {
198
203
  return 0;
199
204
  }
200
205
  });
201
- return Promise.resolve();
202
206
  // end
203
207
  }).then(() => {
204
208
  this.emit("allloaded", ...data);
205
- return Promise.resolve();
206
209
  });
207
210
  }
208
211
  // after releasing, destroy packages data & free "plugins" list, using "data" in arguments for "destroy" plugin's Orchestrator method
209
212
  destroyAll(...data) {
210
- return Promise.resolve().then(() => {
211
- const _destroyPlugin = (i = this.plugins.length - 1) => {
212
- return -1 < i ? Promise.resolve().then(() => {
213
- const pluginName = this.plugins[i].name;
214
- // emit event
215
- return this.plugins[i].destroy().then(() => {
216
- this.emit("destroyed", pluginName, ...data);
217
- return Promise.resolve();
218
- // loop
219
- }).then(() => {
220
- return _destroyPlugin(i - 1);
221
- });
222
- }) : Promise.resolve();
223
- };
224
- return _destroyPlugin();
225
- // end
226
- }).then(() => {
213
+ return Promise.all(this.plugins.map((plugin) => {
214
+ return plugin.destroy().then(() => {
215
+ this.emit("destroyed", plugin.name, ...data);
216
+ });
217
+ })).then(() => {
227
218
  this.plugins = [];
228
219
  this.emit("alldestroyed", ...data);
229
- return Promise.resolve();
230
220
  // remove all external resources
231
221
  }).then(() => {
232
- return (0, rmdirp_1.default)(this.externalRessourcesDirectory);
222
+ return (0, rmdirp_1.default)(this.externalResourcesDirectory);
233
223
  });
234
224
  }
235
225
  // add a function executed before initializing all plugins
236
226
  beforeInitAll(callback) {
237
227
  return (0, checkFunction_1.default)("beforeInitAll/callback", callback).then(() => {
238
228
  this._beforeInitAll = callback;
239
- return Promise.resolve();
240
229
  });
241
230
  }
242
231
  // initialize all plugins asynchronously, using "data" in arguments for "init" plugin's Orchestrator method
243
232
  initAll(...data) {
244
233
  return (0, checkAbsoluteDirectory_1.default)("initAll/directory", this.directory).then(() => {
245
- return (0, checkAbsoluteDirectory_1.default)("initAll/externalRessourcesDirectory", this.externalRessourcesDirectory);
234
+ return (0, checkAbsoluteDirectory_1.default)("initAll/externalResourcesDirectory", this.externalResourcesDirectory);
246
235
  }).then(() => {
247
236
  // execute _beforeInitAll
248
237
  return "function" !== typeof this._beforeInitAll ? Promise.resolve() : new Promise((resolve, reject) => {
@@ -260,29 +249,16 @@ class PluginsManager extends node_events_1.default {
260
249
  // end
261
250
  }).then(() => {
262
251
  this.emit("allinitialized", ...data);
263
- return Promise.resolve();
264
252
  });
265
253
  }
266
254
  // release a plugin (keep package but destroy Mediator & Server), using "data" in arguments for "release" plugin's Orchestrator method
267
255
  releaseAll(...data) {
268
- return Promise.resolve().then(() => {
269
- const _releasePlugin = (i = this.plugins.length - 1) => {
270
- return -1 < i ? Promise.resolve().then(() => {
271
- return this.plugins[i].release(data);
272
- // emit event
273
- }).then(() => {
274
- this.emit("released", this.plugins[i], ...data);
275
- return Promise.resolve();
276
- // loop
277
- }).then(() => {
278
- return _releasePlugin(i - 1);
279
- }) : Promise.resolve();
280
- };
281
- return _releasePlugin();
282
- // end
283
- }).then(() => {
256
+ return Promise.all(this.plugins.map((plugin) => {
257
+ return plugin.release(...data).then(() => {
258
+ this.emit("released", plugin, ...data);
259
+ });
260
+ })).then(() => {
284
261
  this.emit("allreleased", ...data);
285
- return Promise.resolve();
286
262
  });
287
263
  }
288
264
  // install a plugin via github repo, using "data" in arguments for "install" and "init" plugin's Orchestrator methods
@@ -301,11 +277,9 @@ class PluginsManager extends node_events_1.default {
301
277
  });
302
278
  });
303
279
  }).then((directory) => {
304
- return Promise.resolve().then(() => {
305
- return (0, gitInstall_1.default)(directory, user, repo);
306
- }).then(() => {
280
+ return (0, gitInstall_1.default)(directory, user, repo).then(() => {
307
281
  // install dependencies & execute install script
308
- return (0, createPluginByDirectory_1.default)(directory, this.externalRessourcesDirectory, this._logger, ...data);
282
+ return (0, createPluginByDirectory_1.default)(directory, this.externalResourcesDirectory, this._logger, ...data);
309
283
  // check plugin modules versions
310
284
  }).then((plugin) => {
311
285
  return this.checkModules(plugin).then(() => {
@@ -330,14 +304,12 @@ class PluginsManager extends node_events_1.default {
330
304
  });
331
305
  });
332
306
  }).catch((err) => {
333
- return new Promise((resolve, reject) => {
334
- (0, checkAbsoluteDirectory_1.default)("installViaGithub/plugindirectory", directory).then(() => {
335
- return (0, rmdirp_1.default)(directory).then(() => {
336
- return err ? reject(err) : resolve();
337
- });
338
- }).catch(() => {
339
- return err ? reject(err) : resolve();
340
- });
307
+ return (0, checkAbsoluteDirectory_1.default)("installViaGithub/plugindirectory", directory).then(() => {
308
+ return (0, rmdirp_1.default)(directory);
309
+ }).then(() => {
310
+ return Promise.reject(err);
311
+ }).catch(() => {
312
+ return Promise.reject(err);
341
313
  });
342
314
  });
343
315
  });
@@ -373,12 +345,11 @@ class PluginsManager extends node_events_1.default {
373
345
  }).then(() => {
374
346
  this.emit("destroyed", pluginName, ...data);
375
347
  this.plugins.splice(key, 1);
376
- return Promise.resolve();
377
348
  });
378
349
  // download plugin
379
350
  }).then(() => {
380
351
  return (0, gitUpdate_1.default)(directory).then(() => {
381
- return (0, createPluginByDirectory_1.default)(directory, this.externalRessourcesDirectory, this._logger, ...data);
352
+ return (0, createPluginByDirectory_1.default)(directory, this.externalResourcesDirectory, this._logger, ...data);
382
353
  });
383
354
  // check plugin modules versions
384
355
  }).then((_plugin) => {
@@ -425,20 +396,17 @@ class PluginsManager extends node_events_1.default {
425
396
  // release plugin
426
397
  }).then(() => {
427
398
  return plugin.release(...data).then(() => {
428
- return (0, rmdirp_1.default)((0, node_path_1.join)(this.externalRessourcesDirectory));
399
+ return (0, rmdirp_1.default)((0, node_path_1.join)(this.externalResourcesDirectory, pluginName));
429
400
  }).then(() => {
430
401
  this.emit("released", plugin, ...data);
431
402
  return plugin.destroy(...data);
432
403
  }).then(() => {
433
404
  this.emit("destroyed", pluginName, ...data);
434
405
  this.plugins.splice(key, 1);
435
- return Promise.resolve();
436
406
  });
437
407
  // update dependencies & execute update script
438
408
  }).then(() => {
439
- return Promise.resolve().then(() => {
440
- return plugin.uninstall(...data);
441
- }).then(() => {
409
+ return plugin.uninstall(...data).then(() => {
442
410
  this.emit("uninstalled", pluginName, ...data);
443
411
  return (0, rmdirp_1.default)(directory);
444
412
  });
@@ -448,4 +416,3 @@ class PluginsManager extends node_events_1.default {
448
416
  }
449
417
  }
450
418
  exports.default = PluginsManager;
451
- ;
@@ -1 +1 @@
1
- export default function isFunction(dataName: string, data: any): Promise<void>;
1
+ export default function isFunction(dataName: string, data: unknown): Promise<void>;
@@ -1 +1 @@
1
- export default function isNonEmptyArray(dataName: string, data: any): Promise<void>;
1
+ export default function isNonEmptyArray(dataName: string, data: unknown): Promise<void>;
@@ -1 +1 @@
1
- export default function isNonEmptyString(dataName: string, data: any): Promise<void>;
1
+ export default function isNonEmptyString(dataName: string, data: unknown): Promise<void>;
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
- // deps
2
+ /*
3
+ eslint-disable @typescript-eslint/unbound-method
4
+ */
5
+ // => @typescript-eslint/unbound-method is disabled to allow check on data (no need for js context)
3
6
  var __importDefault = (this && this.__importDefault) || function (mod) {
4
7
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
8
  };
6
9
  Object.defineProperty(exports, "__esModule", { value: true });
7
10
  exports.default = checkOrchestrator;
11
+ // deps
8
12
  // natives
9
13
  const node_events_1 = __importDefault(require("node:events"));
10
14
  // locals
@@ -20,18 +20,27 @@ function cmd(directory, command, params) {
20
20
  return (0, checkNonEmptyArray_1.default)("cmd/params", params);
21
21
  }).then(() => {
22
22
  return new Promise((resolve, reject) => {
23
- let result = "";
23
+ let errMsg = "";
24
+ let outMsg = "";
24
25
  const mySpawn = (0, node_child_process_1.spawn)(command, params, {
25
26
  "cwd": directory,
26
27
  "windowsHide": true,
27
28
  "shell": true
28
29
  }).on("error", (err) => {
29
- result += (0, stdToString_1.default)(err);
30
+ errMsg += (0, stdToString_1.default)(err);
30
31
  }).on("close", (code) => {
31
- return code ? reject(new Error(result)) : resolve();
32
+ if (0 < errMsg.length) {
33
+ return code ? reject(new Error(errMsg)) : resolve();
34
+ }
35
+ return code ? reject(new Error(outMsg)) : resolve();
32
36
  });
37
+ mySpawn.stdout.setEncoding("utf8");
38
+ mySpawn.stdout.on("data", (msg) => {
39
+ outMsg += (0, stdToString_1.default)(msg);
40
+ });
41
+ mySpawn.stderr.setEncoding("utf8");
33
42
  mySpawn.stderr.on("data", (msg) => {
34
- result += (0, stdToString_1.default)(msg);
43
+ errMsg += (0, stdToString_1.default)(msg);
35
44
  });
36
45
  });
37
46
  });
@@ -16,7 +16,7 @@ function gitInstall(directory, user, repo) {
16
16
  return (0, checkNonEmptyString_1.default)("cmd/git/install/directory", directory).then(() => {
17
17
  return new Promise((resolve, reject) => {
18
18
  (0, checkDirectory_1.default)("cmd/git/install/directory", directory).then(() => {
19
- reject(new Error("\"" + directory + "\" aldready exists"));
19
+ reject(new Error("\"" + directory + "\" already exists"));
20
20
  }).catch(() => {
21
21
  resolve();
22
22
  });
@@ -1 +1 @@
1
- export default function stdToString(msg: any): string;
1
+ export default function stdToString(msg: unknown): string;
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
- // module
2
+ /*
3
+ eslint-disable @typescript-eslint/no-base-to-string
4
+ */
5
+ // => @typescript-eslint/no-base-to-string is disabled to force stringifying a potential object
3
6
  Object.defineProperty(exports, "__esModule", { value: true });
4
7
  exports.default = stdToString;
8
+ // module
5
9
  function stdToString(msg) {
6
10
  if ("object" !== typeof msg) {
7
11
  return String(msg);
@@ -9,7 +13,10 @@ function stdToString(msg) {
9
13
  else if (msg instanceof Buffer) {
10
14
  return msg.toString("utf8");
11
15
  }
16
+ else if (msg.message) {
17
+ return msg.message;
18
+ }
12
19
  else {
13
- return msg.message ? msg.message : String(msg);
20
+ return String(msg);
14
21
  }
15
22
  }
@@ -1,2 +1,2 @@
1
1
  import type { Orchestrator, tLogger } from "node-pluginsmanager-plugin";
2
- export default function createPluginByDirectory(directory: string, externalRessourcesDirectory: string, logger: tLogger | null, ...data: any): Promise<Orchestrator>;
2
+ export default function createPluginByDirectory(directory: string, externalResourcesDirectory: string, logger: tLogger | null, ...data: unknown[]): Promise<Orchestrator>;
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
- // deps
2
+ /*
3
+ eslint-disable @typescript-eslint/no-var-requires
4
+ */
5
+ // => @typescript-eslint/no-var-requires is disabled to allow plugin load
3
6
  var __importDefault = (this && this.__importDefault) || function (mod) {
4
7
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
8
  };
6
9
  Object.defineProperty(exports, "__esModule", { value: true });
7
10
  exports.default = createPluginByDirectory;
11
+ // deps
8
12
  // natives
9
13
  const node_path_1 = require("node:path");
10
14
  // locals
@@ -12,22 +16,22 @@ const checkAbsoluteDirectory_1 = __importDefault(require("./checkers/checkAbsolu
12
16
  const checkOrchestrator_1 = __importDefault(require("./checkers/checkOrchestrator"));
13
17
  const checkFunction_1 = __importDefault(require("./checkers/checkFunction"));
14
18
  // module
15
- function createPluginByDirectory(directory, externalRessourcesDirectory, logger, ...data) {
19
+ function createPluginByDirectory(directory, externalResourcesDirectory, logger, ...data) {
16
20
  return (0, checkAbsoluteDirectory_1.default)("createPluginByDirectory/directory", directory).then(() => {
17
- return (0, checkAbsoluteDirectory_1.default)("createPluginByDirectory/externalRessourcesDirectory", externalRessourcesDirectory);
21
+ return (0, checkAbsoluteDirectory_1.default)("createPluginByDirectory/externalResourcesDirectory", externalResourcesDirectory);
18
22
  }).then(() => {
19
23
  return new Promise((resolve, reject) => {
20
24
  try {
21
25
  resolve(require(directory));
22
26
  }
23
27
  catch (e) {
24
- reject(e);
28
+ reject(e instanceof Error ? e : new Error(String(e)));
25
29
  }
26
30
  }).then((Plugin) => {
27
- if (Plugin.Orchestrator) {
31
+ if (["function", "object"].includes(typeof Plugin.Orchestrator)) {
28
32
  return Promise.resolve(Plugin.Orchestrator);
29
33
  }
30
- else if (Plugin.default) {
34
+ else if (["function", "object"].includes(typeof Plugin.default)) {
31
35
  return Promise.resolve(Plugin.default);
32
36
  }
33
37
  else {
@@ -38,7 +42,7 @@ function createPluginByDirectory(directory, externalRessourcesDirectory, logger,
38
42
  const pluginBaseNameDirectory = (0, node_path_1.basename)(directory);
39
43
  const plugin = new Plugin({
40
44
  // usefull for inherited Orchestrators
41
- "externalRessourcesDirectory": (0, node_path_1.join)(externalRessourcesDirectory, pluginBaseNameDirectory),
45
+ "externalResourcesDirectory": (0, node_path_1.join)(externalResourcesDirectory, pluginBaseNameDirectory),
42
46
  "logger": logger,
43
47
  // useless, setted in inherited Orchestrators
44
48
  "packageFile": "",
@@ -3,5 +3,5 @@ interface OrchestratorExtended extends Orchestrator {
3
3
  "github"?: string;
4
4
  "repository"?: string | Record<string, string>;
5
5
  }
6
- export default function extractGithub(plugin: OrchestratorExtended): string;
6
+ export default function extractGithub(plugin: OrchestratorExtended): string | null;
7
7
  export {};
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.default = extractGithub;
5
5
  // module
6
6
  function extractGithub(plugin) {
7
- let github = "";
7
+ let github = null;
8
8
  if ("object" === typeof plugin) {
9
9
  if ("string" === typeof plugin.github) {
10
10
  github = plugin.github;
@@ -16,5 +16,5 @@ function extractGithub(plugin) {
16
16
  github = plugin.repository.url;
17
17
  }
18
18
  }
19
- return github;
19
+ return github ?? null;
20
20
  }
@@ -1,2 +1,2 @@
1
1
  import type { Orchestrator } from "node-pluginsmanager-plugin";
2
- export default function initSortedPlugins(plugins: Orchestrator[], orderedPluginsNames: string[], emit: (eventName: string, ...subdata: any) => void, ...data: any): Promise<void>;
2
+ export default function initSortedPlugins(plugins: Orchestrator[], orderedPluginsNames: string[], emit: (eventName: string, ...subdata: unknown[]) => void, ...data: unknown[]): Promise<void>;
@@ -1,2 +1,2 @@
1
1
  import type { Orchestrator, tLogger } from "node-pluginsmanager-plugin";
2
- export default function loadSortedPlugins(globalDirectory: string, externalRessourcesDirectory: string, files: string[], loadedPlugins: Orchestrator[], orderedPluginsNames: string[], emit: (eventName: string, ...subdata: any) => void, logger: tLogger | null, ...data: any): Promise<void>;
2
+ export default function loadSortedPlugins(globalDirectory: string, externalResourcesDirectory: string, files: string[], loadedPlugins: Orchestrator[], orderedPluginsNames: string[], emit: (eventName: string, ...subdata: unknown[]) => void, logger: tLogger | null, ...data: unknown[]): Promise<void>;
@@ -11,7 +11,7 @@ const node_path_1 = require("node:path");
11
11
  const createPluginByDirectory_1 = __importDefault(require("./createPluginByDirectory"));
12
12
  // private
13
13
  // methods
14
- function _loadPlugin(globalDirectory, externalRessourcesDirectory, pluginFileName, loadedPlugins, emit, logger, ...data) {
14
+ function _loadPlugin(globalDirectory, externalResourcesDirectory, pluginFileName, loadedPlugins, emit, logger, ...data) {
15
15
  // is already loaded ?
16
16
  const plugin = loadedPlugins.find((p) => {
17
17
  return pluginFileName === p.name;
@@ -20,7 +20,7 @@ function _loadPlugin(globalDirectory, externalRessourcesDirectory, pluginFileNam
20
20
  return plugin ? Promise.resolve() : Promise.resolve().then(() => {
21
21
  emit("loading", pluginFileName, ...data);
22
22
  const directory = (0, node_path_1.join)(globalDirectory, pluginFileName);
23
- return (0, createPluginByDirectory_1.default)(directory, externalRessourcesDirectory, logger, ...data);
23
+ return (0, createPluginByDirectory_1.default)(directory, externalResourcesDirectory, logger, ...data);
24
24
  // emit event
25
25
  }).then((createdPlugin) => {
26
26
  emit("loaded", createdPlugin, ...data);
@@ -28,16 +28,16 @@ function _loadPlugin(globalDirectory, externalRessourcesDirectory, pluginFileNam
28
28
  return Promise.resolve();
29
29
  });
30
30
  }
31
- function _loadPlugins(globalDirectory, externalRessourcesDirectory, pluginsToLoad, loadedPlugins, emit, logger, data, i = 0) {
31
+ function _loadPlugins(globalDirectory, externalResourcesDirectory, pluginsToLoad, loadedPlugins, emit, logger, i, ...data) {
32
32
  return i < pluginsToLoad.length ? Promise.resolve().then(() => {
33
- return _loadPlugin(globalDirectory, externalRessourcesDirectory, pluginsToLoad[i], loadedPlugins, emit, logger, ...data);
33
+ return _loadPlugin(globalDirectory, externalResourcesDirectory, pluginsToLoad[i], loadedPlugins, emit, logger, ...data);
34
34
  // loop
35
35
  }).then(() => {
36
- return _loadPlugins(globalDirectory, externalRessourcesDirectory, pluginsToLoad, loadedPlugins, emit, logger, data, i + 1);
36
+ return _loadPlugins(globalDirectory, externalResourcesDirectory, pluginsToLoad, loadedPlugins, emit, logger, i + 1, ...data);
37
37
  }) : Promise.resolve();
38
38
  }
39
39
  // module
40
- function loadSortedPlugins(globalDirectory, externalRessourcesDirectory, files, loadedPlugins, orderedPluginsNames, emit, logger, ...data) {
40
+ function loadSortedPlugins(globalDirectory, externalResourcesDirectory, files, loadedPlugins, orderedPluginsNames, emit, logger, ...data) {
41
41
  // if no files, does not run
42
42
  return !files.length ? Promise.resolve() : Promise.resolve().then(() => {
43
43
  const sortedPluginsNames = [];
@@ -45,13 +45,13 @@ function loadSortedPlugins(globalDirectory, externalRessourcesDirectory, files,
45
45
  const plugin = files.find((p) => {
46
46
  return p === pluginName;
47
47
  });
48
- if (plugin) {
48
+ if ("string" === typeof plugin) {
49
49
  sortedPluginsNames.push(pluginName);
50
50
  }
51
51
  });
52
52
  // first, sorted plugins
53
53
  return sortedPluginsNames.length
54
- ? _loadPlugins(globalDirectory, externalRessourcesDirectory, sortedPluginsNames, loadedPlugins, emit, logger, data)
54
+ ? _loadPlugins(globalDirectory, externalResourcesDirectory, sortedPluginsNames, loadedPlugins, emit, logger, 0, ...data)
55
55
  : Promise.resolve();
56
56
  }).then(() => {
57
57
  const unsortedPluginsNames = [
@@ -71,7 +71,7 @@ function loadSortedPlugins(globalDirectory, externalRessourcesDirectory, files,
71
71
  ];
72
72
  // then, all other plugins, asynchronously
73
73
  return unsortedPluginsNames.length
74
- ? _loadPlugins(globalDirectory, externalRessourcesDirectory, unsortedPluginsNames, loadedPlugins, emit, logger, data)
74
+ ? _loadPlugins(globalDirectory, externalResourcesDirectory, unsortedPluginsNames, loadedPlugins, emit, logger, 0, ...data)
75
75
  : Promise.resolve();
76
76
  });
77
77
  }
package/package.json CHANGED
@@ -1,89 +1,95 @@
1
- {
2
-
3
- "name": "node-pluginsmanager",
4
- "version": "2.5.1",
5
- "description": "A plugins manager",
6
-
7
- "type": "commonjs",
8
- "typings": "./lib/cjs/main.d.cts",
9
- "main": "./lib/cjs/main.cjs",
10
-
11
- "exports": {
12
- ".": {
13
- "require": {
14
- "types": "./lib/cjs/main.d.cts",
15
- "default": "./lib/cjs/main.cjs"
16
- }
17
- }
18
- },
19
-
20
- "scripts": {
21
-
22
- "prepare": "npx husky",
23
-
24
- "clean": "npx rimraf ./lib/cjs",
25
- "build": "npm run-script clean && npx tsc --project \"./tsconfig.json\"",
26
-
27
- "lint": "npx eslint --config .eslintrc-src.js --ext .cts,.ts ./lib/src/**/* && npx eslint --config .eslintrc-tests.js ./bin/*.js ./test/**/*.js",
28
- "check-requires": "npx used-deps-analyzer \"./package.json\" \"./lib/src\" --no-dev --overkill \"fs-extra\" \"node-promfs\"",
29
- "check-updates": "npx check-version-modules",
30
- "unit-tests": "npm run-script build && npx nyc --reporter=html --reporter=text mocha",
31
-
32
- "tests": "npm run-script lint && npm run-script check-requires && npm run-script check-updates && npm run-script unit-tests"
33
-
34
- },
35
-
36
- "files": [
37
- "/bin",
38
- "/lib/cjs",
39
- "/public"
40
- ],
41
- "engines": {
42
- "node": ">=16.0.0"
43
- },
44
-
45
- "dependencies": {
46
- "check-version-modules": "2.1.3"
47
- },
48
- "devDependencies": {
49
- "@types/express": "5.0.3",
50
- "@types/node": "24.3.0",
51
- "@types/socket.io": "3.0.2",
52
- "@types/ws": "8.18.1",
53
- "eslint-plugin-personnallinter": "git+ssh://git@github.com/Psychopoulet/eslint-plugin-personnallinter",
54
- "express": "5.1.0",
55
- "husky": "9.1.7",
56
- "mocha": "11.7.1",
57
- "node-pluginsmanager-plugin": "6.4.5",
58
- "nyc": "17.1.0",
59
- "rimraf": "6.0.1",
60
- "socket.io": "4.8.1",
61
- "typescript": "5.9.2",
62
- "used-deps-analyzer": "0.1.8",
63
- "ws": "8.18.3"
64
- },
65
- "optionalDependencies": {},
66
-
67
- "husky": {
68
- "hooks": {
69
- "pre-push": "npm run-script tests"
70
- }
71
- },
72
- "keywords": [
73
- "plugin",
74
- "manage",
75
- "gestion"
76
- ],
77
- "author": "Sébastien VIDAL",
78
- "license": "ISC",
79
-
80
- "homepage": "https://github.com/Psychopoulet/node-pluginsmanager#readme",
81
- "repository": {
82
- "type": "git",
83
- "url": "git://github.com/Psychopoulet/node-pluginsmanager"
84
- },
85
- "bugs": {
86
- "url": "https://github.com/Psychopoulet/node-pluginsmanager/issues"
87
- }
88
-
89
- }
1
+ {
2
+
3
+ "name": "node-pluginsmanager",
4
+ "version": "3.0.0",
5
+ "description": "A plugins manager.",
6
+
7
+ "type": "commonjs",
8
+ "typings": "./lib/cjs/main.d.cts",
9
+ "main": "./lib/cjs/main.cjs",
10
+
11
+ "exports": {
12
+ ".": {
13
+ "require": {
14
+ "types": "./lib/cjs/main.d.cts",
15
+ "default": "./lib/cjs/main.cjs"
16
+ }
17
+ }
18
+ },
19
+
20
+ "scripts": {
21
+
22
+ "prepare": "npx husky || true",
23
+
24
+ "lint-back": "npx eslint --config .eslintrc-back.js --ext .ts,.cts,.mts ./lib/src/**/*",
25
+ "lint-tests": "npx eslint --config .eslintrc-tests.js --ext .js,.cjs,.mjs ./test/**/*.js",
26
+ "lint": "npm run lint-back && npm run lint-tests",
27
+
28
+ "clean-back": "npx rimraf ./lib/cjs",
29
+ "clean": "npm run clean-back",
30
+
31
+ "build-back": "npm run clean-back && npx tsc --project ./tsconfig.json",
32
+ "build": "npm run build-back",
33
+
34
+ "check-requires": "npx used-deps-analyzer ./package.json ./lib/src --no-dev",
35
+ "check-updates": "npx check-version-modules",
36
+ "unit-tests": "npm run build && npx nyc --reporter=html --reporter=text mocha",
37
+
38
+ "tests": "npm run lint && npm run check-requires && npm run check-updates && npm run unit-tests"
39
+
40
+ },
41
+
42
+ "files": [
43
+ "/lib/cjs"
44
+ ],
45
+ "engines": {
46
+ "node": ">=22.22.0"
47
+ },
48
+
49
+ "dependencies": {
50
+ "check-version-modules": "2.2.2"
51
+ },
52
+ "devDependencies": {
53
+ "@types/express": "5.0.6",
54
+ "@types/node": "25.5.0",
55
+ "@types/socket.io": "3.0.2",
56
+ "@types/ws": "8.18.1",
57
+ "eslint-plugin-personnallinter": "git+ssh://git@github.com/Psychopoulet/eslint-plugin-personnallinter",
58
+ "express": "5.2.1",
59
+ "husky": "9.1.7",
60
+ "mocha": "11.7.5",
61
+ "node-pluginsmanager-plugin": "6.5.0",
62
+ "nyc": "18.0.0",
63
+ "proxyquire": "2.1.3",
64
+ "rimraf": "6.1.3",
65
+ "socket.io": "4.8.3",
66
+ "typescript": "5.9.3",
67
+ "used-deps-analyzer": "0.2.0",
68
+ "ws": "8.19.0"
69
+ },
70
+
71
+ "husky": {
72
+ "hooks": {
73
+ "pre-commit": "npm run lint",
74
+ "pre-push": "npm run unit-tests"
75
+ }
76
+ },
77
+
78
+ "keywords": [
79
+ "plugin",
80
+ "manage",
81
+ "gestion"
82
+ ],
83
+ "author": "Sébastien VIDAL",
84
+ "license": "ISC",
85
+
86
+ "homepage": "https://github.com/Psychopoulet/node-pluginsmanager#readme",
87
+ "repository": {
88
+ "type": "git",
89
+ "url": "git://github.com/Psychopoulet/node-pluginsmanager.git"
90
+ },
91
+ "bugs": {
92
+ "url": "https://github.com/Psychopoulet/node-pluginsmanager/issues"
93
+ }
94
+
95
+ }