fluxion-ts 0.6.0 → 0.6.1

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 (2) hide show
  1. package/README.md +46 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  Fluxion is a filesystem-routing dynamic server for Node.js.
14
14
 
15
- - Route files from a dynamic directory(by chokidar)
15
+ - Route files from a dynamic directory by chokidar or native `fs.watch`
16
16
  - Load API handlers by extension, default: `.ts`
17
17
  - Serve other files as static resources
18
18
  - Run the business server in worker processes
@@ -283,6 +283,7 @@ interface FluxionOptions {
283
283
  port: number;
284
284
  reloadDelay?: number;
285
285
  metaPort?: number;
286
+ nativeWatcher?: boolean;
286
287
  injections?: InjectionConfig[];
287
288
  moduleDir?: string;
288
289
  workerOptions?: Partial<WorkerOptions>;
@@ -318,6 +319,28 @@ Primary meta API port. Defaults to `port + 1` and must be different from `port`.
318
319
 
319
320
  Debounce delay for file re-registration. Defaults to `300` and must be at least `50`.
320
321
 
322
+ ### `nativeWatcher`
323
+
324
+ Use native file watcher (`fs.watch`) instead of chokidar. Defaults to `false`.
325
+
326
+ When set to `true`, Fluxion uses Node.js built-in `fs.watch()` for file watching. When `false` (default), it uses `chokidar` for better cross-platform compatibility.
327
+
328
+ **Trade-offs:**
329
+
330
+ - `chokidar` (default): Better cross-platform support, more stable, handles edge cases
331
+ - `fs.watch`: Native implementation, lighter weight, but may have platform-specific quirks
332
+
333
+ Example:
334
+
335
+ ```ts
336
+ fluxion({
337
+ dir: './dynamicDirectory',
338
+ host: '127.0.0.1',
339
+ port: 3000,
340
+ nativeWatcher: true, // use native fs.watch instead of chokidar
341
+ });
342
+ ```
343
+
321
344
  ### `apiExts`
322
345
 
323
346
  Extensions registered as API handlers. Defaults to:
@@ -428,6 +451,28 @@ Primary meta API port. Defaults to `port + 1` and must be different from `port`.
428
451
 
429
452
  Debounce delay for file re-registration. Defaults to `300` and must be at least `50`.
430
453
 
454
+ ### `nativeWatcher`
455
+
456
+ Use native file watcher (`fs.watch`) instead of chokidar. Defaults to `false`.
457
+
458
+ When set to `true`, Fluxion uses Node.js built-in `fs.watch()` for file watching. When `false` (default), it uses `chokidar` for better cross-platform compatibility.
459
+
460
+ **Trade-offs:**
461
+
462
+ - `chokidar` (default): Better cross-platform support, more stable, handles edge cases
463
+ - `fs.watch`: Native implementation, lighter weight, but may have platform-specific quirks
464
+
465
+ Example:
466
+
467
+ ```ts
468
+ fluxion({
469
+ dir: './dynamicDirectory',
470
+ host: '127.0.0.1',
471
+ port: 3000,
472
+ nativeWatcher: true, // use native fs.watch instead of chokidar
473
+ });
474
+ ```
475
+
431
476
  ### `apiExts`
432
477
 
433
478
  Extensions registered as API handlers. Defaults to:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxion-ts",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "author": {
5
5
  "name": "Kasukabe Tsumugi",
6
6
  "email": "futami16237@gmail.com"