@zenfs/core 2.8.0 → 2.8.2

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.
@@ -1,4 +1,5 @@
1
1
  import type * as fs from 'node:fs';
2
+ import type { Stream } from 'node:stream';
2
3
  /**
3
4
  * @hidden
4
5
  */
@@ -11,11 +12,15 @@ export type NodeReaddirOptions = {
11
12
  * Notes on omissions and exclusions:
12
13
  * - `__promisify__` is omitted since it is type metadata
13
14
  * - `native` is omitted since zenfs isn't native
15
+ * - Static members that `ReadStream` and `WriteStream` inherit from `node:stream` are omitted since they aren't part of the `fs` API
14
16
  * @internal @hidden
15
17
  */
16
18
  export type NodeFS = {
17
19
  [K in keyof typeof fs]: (typeof fs)[K] extends (...args: any[]) => any ? // Some kind of wizardry: by using a union with a regular function, overloads are preserved but the properties disappear.
18
- (typeof fs)[K] | ((...args: any[]) => any) : (typeof fs)[K] extends object ? Omit<(typeof fs)[K], '__promisify__' | 'native'> : (typeof fs)[K];
20
+ (typeof fs)[K] | ((...args: any[]) => any) : (typeof fs)[K] extends object ? Omit<(typeof fs)[K], '__promisify__' | 'native' | (K extends 'ReadStream' | 'WriteStream' ? StreamStatics : never)> : (typeof fs)[K];
19
21
  };
22
+ /** @internal @hidden */
23
+ type StreamStatics = Exclude<keyof typeof Stream, 'prototype'>;
20
24
  /** Helper union @hidden */
21
25
  export type GlobOptionsU = fs.GlobOptionsWithFileTypes | fs.GlobOptionsWithoutFileTypes | fs.GlobOptions;
26
+ export {};
package/eslint.shared.js CHANGED
@@ -3,6 +3,7 @@ import eslint from '@eslint/js';
3
3
  import globals from 'globals';
4
4
  import { configs } from 'typescript-eslint';
5
5
 
6
+ /** @deprecated Use `@zenfs/devel/eslint` */
6
7
  export default [
7
8
  {
8
9
  name: 'ZenFS',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenfs/core",
3
- "version": "2.8.0",
3
+ "version": "2.8.2",
4
4
  "description": "A filesystem, anywhere",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -66,8 +66,8 @@
66
66
  "spdx:check": "npx lice -a src tests/*.ts tests/**/*.test.ts",
67
67
  "spdx:fix": "npx lice -aw src tests/*.ts tests/**/*.test.ts",
68
68
  "lint": "eslint src tests",
69
- "test": "npx -s zenfs-test --clean; npx -s zenfs-test -abcpn; tests/fetch/run.sh; npx -s zenfs-test --report-only",
70
- "test:native": "npx -s zenfs-test -n tests/native-setup.ts --verbose",
69
+ "test": "npx -s zenfs-test -abc --report",
70
+ "test:native": "npx -s zenfs-test tests/native-setup.ts --verbose",
71
71
  "test:perf": "zbench",
72
72
  "build": "tsc --build",
73
73
  "dev": "tsc --build --watch",
@@ -75,7 +75,7 @@
75
75
  },
76
76
  "dependencies": {
77
77
  "@types/node": "^26.0.0",
78
- "@zenfs/streams": "^1.0.0",
78
+ "@zenfs/streams": "^1.0.2",
79
79
  "buffer": "^6.0.3",
80
80
  "eventemitter3": "^5.0.1",
81
81
  "kerium": "^1.5.0",
@@ -83,17 +83,18 @@
83
83
  "utilium": "^3.7.0"
84
84
  },
85
85
  "devDependencies": {
86
- "@eslint/js": "^10.0.1",
87
- "@octokit/action": "^8.0.4",
88
- "c8": "^12.0.0",
86
+ "@zenfs/devel": "^0.1.0",
89
87
  "eslint": "^10.1.0",
90
- "globals": "^17.3.0",
91
88
  "prettier": "^3.2.5",
92
89
  "typedoc": "^0.28.18",
93
90
  "typescript": "^6.0.0",
94
- "typescript-eslint": "^8.58.0",
95
91
  "zbench-js": "^0.2.0"
96
92
  },
93
+ "overrides": {
94
+ "@zenfs/devel": {
95
+ "@zenfs/core": "file:../../.."
96
+ }
97
+ },
97
98
  "prettier": {
98
99
  "singleQuote": true,
99
100
  "useTabs": true,
package/scripts/ci-cli.js CHANGED
@@ -1,7 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import { spawnSync } from 'node:child_process';
3
3
  import { parseArgs } from 'node:util';
4
- import * as ci from './ci.js';
4
+ import { useDevel } from './deprecated.js';
5
+
6
+ await useDevel('zci');
7
+
8
+ const ci = await import('./ci.js');
5
9
 
6
10
  const {
7
11
  values: options,
@@ -2,6 +2,9 @@
2
2
  import { constants as c, lstatSync, readdirSync, writeFileSync } from 'node:fs';
3
3
  import { join, matchesGlob, relative, resolve } from 'node:path/posix';
4
4
  import { parseArgs, styleText } from 'node:util';
5
+ import { useDevel } from './deprecated.js';
6
+
7
+ await useDevel('make-index');
5
8
 
6
9
  const { values: options, positionals } = parseArgs({
7
10
  options: {
package/scripts/test.js CHANGED
@@ -4,6 +4,9 @@ import { execFileSync } from 'node:child_process';
4
4
  import { existsSync, globSync, mkdirSync, rmSync } from 'node:fs';
5
5
  import { join, parse, basename } from 'node:path';
6
6
  import { parseArgs, styleText } from 'node:util';
7
+ import { useDevel } from './deprecated.js';
8
+
9
+ await useDevel('zenfs-test');
7
10
 
8
11
  const { values: options, positionals } = parseArgs({
9
12
  options: {
@@ -1,7 +1,7 @@
1
1
  import { parentPort } from 'node:worker_threads';
2
2
  import { resolveRemoteMount } from '../../dist/backends/port.js';
3
3
  import { InMemory } from '../../dist/backends/memory.js';
4
- import { setupLogs } from '../logs.js';
4
+ import { setupLogs } from '@zenfs/devel/tests/logs';
5
5
 
6
6
  setupLogs('<config>');
7
7
 
@@ -2,7 +2,7 @@
2
2
  import { CopyOnWriteFS, InMemoryStore, StoreFS } from '@zenfs/core';
3
3
  import assert from 'node:assert/strict';
4
4
  import { suite, test } from 'node:test';
5
- import { setupLogs } from '../logs.js';
5
+ import { setupLogs } from '@zenfs/devel/tests/logs';
6
6
  setupLogs();
7
7
 
8
8
  const size = 1 << 20;
@@ -1,17 +1,25 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-or-later
2
2
  import { CopyOnWrite, Fetch, InMemory, configureSingle, fs, mounts, resolveMountConfig, type FetchFS } from '@zenfs/core';
3
+ import { setupLogs } from '@zenfs/devel/tests/logs';
4
+ import { data } from '@zenfs/devel/tests/setup';
3
5
  import assert from 'node:assert/strict';
6
+ import { once } from 'node:events';
7
+ import { readdirSync } from 'node:fs';
4
8
  import { join } from 'node:path';
5
9
  import { after, suite, test } from 'node:test';
6
10
  import { Worker } from 'node:worker_threads';
7
- import { baseUrl, defaultEntries, indexPath, whenServerReady } from '../fetch/config.js';
8
- import { setupLogs } from '../logs.js';
9
11
 
10
12
  setupLogs();
11
13
 
12
- const server = new Worker(join(import.meta.dirname, '../fetch/server.js'));
14
+ const server = new Worker(join(import.meta.dirname, 'fetch.worker.js'));
13
15
 
14
- await whenServerReady();
16
+ const [port] = await once(server, 'message');
17
+
18
+ const baseUrl = 'http://localhost:' + port;
19
+
20
+ const indexPath = '/.index.json';
21
+
22
+ const defaultEntries = readdirSync(data);
15
23
 
16
24
  await configureSingle({
17
25
  backend: Fetch,
@@ -1,24 +1,17 @@
1
- import { execFileSync } from 'node:child_process';
2
- import { readFileSync } from 'node:fs';
1
+ import { readFileSync, lstatSync, readdirSync } from 'node:fs';
3
2
  import { createServer } from 'node:http';
3
+ import { data } from '@zenfs/devel/tests/setup';
4
4
  import { join } from 'node:path';
5
- import { data, indexPath, port, tmp } from './config.js';
5
+ import { parentPort } from 'node:worker_threads';
6
6
 
7
7
  const statusCodes = {
8
8
  ENOENT: 404,
9
9
  };
10
10
 
11
- try {
12
- execFileSync('npx', ['--silent', 'make-index', data, '--output', `${tmp}/index.json`, '--quiet'], { stdio: 'inherit' });
13
- } catch (e) {
14
- if (e.signal == 'SIGINT') {
15
- console.log('Aborted whilst creating index');
16
- process.exit(0);
17
- } else {
18
- console.error('Index creation failed: ' + e.message);
19
- process.exit(1);
20
- }
21
- }
11
+ const entries = {};
12
+ for (const path of ['', ...readdirSync(data, { recursive: true })]) entries['/' + path] = lstatSync(join(data, path));
13
+
14
+ const index = JSON.stringify({ version: 1, entries });
22
15
 
23
16
  const server = createServer((request, response) => {
24
17
  response.statusCode = 200;
@@ -37,7 +30,12 @@ const server = createServer((request, response) => {
37
30
  return;
38
31
  }
39
32
 
40
- const path = url == indexPath ? join(tmp, 'index.json') : join(data, url.slice(1) || '');
33
+ if (url == '/.index.json') {
34
+ response.end(index);
35
+ return;
36
+ }
37
+
38
+ const path = join(data, url.slice(1) || '');
41
39
  try {
42
40
  response.end(readFileSync(path));
43
41
  } catch (e) {
@@ -46,7 +44,7 @@ const server = createServer((request, response) => {
46
44
  }
47
45
  });
48
46
 
49
- server.listen(port);
47
+ server.listen(0, () => parentPort.postMessage(server.address().port));
50
48
 
51
49
  process.on('beforeExit', () => {
52
50
  server.close().unref();
@@ -4,7 +4,7 @@ import { InMemory, Port, attachFS, configure, configureSingle, fs, resolveMountC
4
4
  import assert from 'node:assert/strict';
5
5
  import { after, suite, test } from 'node:test';
6
6
  import { MessageChannel, Worker } from 'node:worker_threads';
7
- import { setupLogs } from '../logs.js';
7
+ import { setupLogs } from '@zenfs/devel/tests/logs';
8
8
  setupLogs();
9
9
 
10
10
  // Tests a mis-configured `Port` using a MessageChannel
@@ -1,7 +1,7 @@
1
1
  import { parentPort } from 'node:worker_threads';
2
2
  import { attachFS } from '../../dist/backends/port.js';
3
3
  import { mounts } from '../../dist/index.js';
4
- import { setupLogs } from '../logs.js';
4
+ import { setupLogs } from '@zenfs/devel/tests/logs';
5
5
 
6
6
  setupLogs('<remote>');
7
7
 
@@ -1,7 +1,7 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-or-later
2
2
  import { parentPort, workerData } from 'node:worker_threads';
3
3
  import { SuperBlock } from '../../dist/backends/single_buffer/v1.js';
4
- import { setupLogs } from '../logs.js';
4
+ import { setupLogs } from '@zenfs/devel/tests/logs';
5
5
 
6
6
  setupLogs('<worker>');
7
7
 
@@ -7,7 +7,7 @@ import assert from 'node:assert/strict';
7
7
  import { randomBytes } from 'node:crypto';
8
8
  import { suite, test } from 'node:test';
9
9
  import { Worker } from 'worker_threads';
10
- import { setupLogs } from '../logs.js';
10
+ import { setupLogs } from '@zenfs/devel/tests/logs';
11
11
 
12
12
  setupLogs();
13
13
 
@@ -3,7 +3,7 @@ import { writeFileSync as _write } from 'node:fs';
3
3
  import { parentPort, workerData } from 'node:worker_threads';
4
4
  import { SingleBufferStore as SingleBufferStoreV2, SuperBlock } from '../../dist/backends/single_buffer/v2.js';
5
5
  import { configureSingle, fs, SingleBuffer } from '../../dist/index.js';
6
- import { setupLogs } from '../logs.js';
6
+ import { setupLogs } from '@zenfs/devel/tests/logs';
7
7
 
8
8
  setupLogs('<worker>');
9
9
 
@@ -6,7 +6,7 @@ import { Worker } from 'worker_threads';
6
6
  import { sizeof } from 'memium';
7
7
  import { fs, mount, resolveMountConfig, SingleBuffer, vfs } from '@zenfs/core';
8
8
  import { MetadataBlock, SuperBlock } from '@zenfs/core/backends/single_buffer/v1';
9
- import { setupLogs } from '../logs.js';
9
+ import { setupLogs } from '@zenfs/devel/tests/logs';
10
10
 
11
11
  setupLogs();
12
12
 
@@ -2,7 +2,7 @@ import assert from 'node:assert/strict';
2
2
  import { writeFileSync as _write } from 'node:fs';
3
3
  import { parentPort, workerData } from 'node:worker_threads';
4
4
  import { configureSingle, fs, SingleBuffer } from '../../dist/index.js';
5
- import { setupLogs } from '../logs.js';
5
+ import { setupLogs } from '@zenfs/devel/tests/logs';
6
6
 
7
7
  setupLogs('<worker>');
8
8
 
@@ -2,7 +2,7 @@
2
2
  import { InMemoryStore, StoreFS } from '@zenfs/core';
3
3
  import assert from 'node:assert/strict';
4
4
  import { suite, test } from 'node:test';
5
- import { setupLogs } from '../logs.js';
5
+ import { setupLogs } from '@zenfs/devel/tests/logs';
6
6
  setupLogs();
7
7
 
8
8
  const fs = new StoreFS(new InMemoryStore(0x100000, 'test'));
@@ -1,7 +1,7 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-or-later
2
2
  import assert from 'node:assert/strict';
3
3
  import { suite, test } from 'node:test';
4
- import { fs } from '../common.ts';
4
+ import { fs } from '@zenfs/devel/tests/common';
5
5
 
6
6
  // Set up a directory structure for glob tests
7
7
  fs.mkdirSync('/glob');
@@ -2,7 +2,7 @@
2
2
  import { Buffer } from 'buffer';
3
3
  import assert from 'node:assert/strict';
4
4
  import { suite, test } from 'node:test';
5
- import { config, fs } from '../common.ts';
5
+ import { config, fs } from '@zenfs/devel/tests/common';
6
6
 
7
7
  suite('Utf8Stream', config('write'), () => {
8
8
  test('writes synchronously', config('sync'), () => {
package/tests/common.ts CHANGED
@@ -19,11 +19,13 @@ const setup = await import(setupPath).catch(error => {
19
19
  });
20
20
 
21
21
  // Satisfies is used to make sure that ZenFS is fully type compatible with Node.js
22
+ /** @deprecated Use `@zenfs/devel/tests/common` */
22
23
  export const fs = (setup.fs || defaultFS) as typeof defaultFS satisfies NodeFS;
23
24
 
24
25
  /**
25
26
  * A feature or function a backend may not support.
26
27
  * Tests that need one are skipped when the backend under test does not have it.
28
+ * @deprecated Use `@zenfs/devel/tests/common`
27
29
  */
28
30
  export type TestFlag =
29
31
  | 'sync'
@@ -50,13 +52,17 @@ export type TestFlag =
50
52
  *
51
53
  * `false` is for things a backend can not support, while `'skip'` is for temporarily disabling something.
52
54
  * `'todo'` is for things that should work but don't yet.
55
+ * @deprecated Use `@zenfs/devel/tests/common`
53
56
  */
54
57
  export type TestFlagState = boolean | 'skip' | 'todo';
55
58
 
56
59
  /** Flags are supported unless the setup says otherwise */
57
60
  const flags = (setup.flags ?? {}) as Partial<Record<TestFlag, TestFlagState>>;
58
61
 
59
- /** Options for `suite` and `test`. Note this is a subset of both, since they do not share a type. */
62
+ /**
63
+ * Options for `suite` and `test`. Note this is a subset of both, since they do not share a type.
64
+ * @deprecated Use `@zenfs/devel/tests/common`
65
+ */
60
66
  export interface TestConfig {
61
67
  skip?: string;
62
68
  todo?: string;
@@ -69,6 +75,7 @@ export interface TestConfig {
69
75
  * ```ts
70
76
  * test('lchmod', config('lchmod', 'async'), async () => { ... });
71
77
  * ```
78
+ * @deprecated Use `@zenfs/devel/tests/common`
72
79
  */
73
80
  export function config(...required: TestFlag[]): TestConfig {
74
81
  for (const flag of required) {
package/tests/logs.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { log } from 'kerium';
2
2
 
3
+ /** @deprecated Use `@zenfs/devel/tests/logs` */
3
4
  export function setupLogs(prefix) {
4
5
  const { ZENFS_LOG_LEVEL } = process.env;
5
6
 
@@ -2,10 +2,10 @@
2
2
  /* Run the FS test suite against native node:fs.
3
3
  Since the tests use absolute paths, everything is contained to a scratch directory using chroot-style path mapping. */
4
4
  import * as native from 'node:fs';
5
- import type { TestFlag, TestFlagState } from './common.ts';
5
+ import type { TestFlag, TestFlagState } from '@zenfs/devel/tests/common';
6
6
  import { isAbsolute, join, relative, resolve } from 'node:path';
7
7
  import { fileURLToPath } from 'node:url';
8
- import { copySync, data, tmp } from './setup.ts';
8
+ import { copySync, data, tmp } from '@zenfs/devel/tests/setup';
9
9
  import { styleText } from 'node:util';
10
10
  import { isRoot } from 'utilium/node';
11
11
 
@@ -1,5 +1,5 @@
1
1
  import { fs as _fs, bindContext } from '@zenfs/core';
2
- import { copySync, data } from '../setup.ts';
2
+ import { copySync, data } from '@zenfs/devel/tests/setup';
3
3
 
4
4
  _fs.mkdirSync('/new_root');
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { configureSingle, CopyOnWrite, fs, InMemory, resolveMountConfig } from '@zenfs/core';
2
- import { copySync, data } from '../setup.ts';
2
+ import { copySync, data } from '@zenfs/devel/tests/setup';
3
3
 
4
4
  fs.umount('/');
5
5
  const readable = await resolveMountConfig({ backend: InMemory, label: 'ro' });
@@ -1,7 +1,18 @@
1
1
  import { configure, Fetch } from '@zenfs/core';
2
+ import type { TestFlag, TestFlagState } from '@zenfs/devel/tests/common';
2
3
  import { log } from 'kerium';
3
- import type { TestFlag, TestFlagState } from '../common.ts';
4
- import { baseUrl } from './config.js';
4
+ import { once } from 'node:events';
5
+ import { join } from 'node:path';
6
+ import { after } from 'node:test';
7
+ import { Worker } from 'node:worker_threads';
8
+
9
+ const server = new Worker(join(import.meta.dirname, '../backend/fetch.worker.js'));
10
+
11
+ after(() => server.terminate());
12
+
13
+ const [port] = await once(server, 'message');
14
+
15
+ const baseUrl = 'http://localhost:' + port;
5
16
 
6
17
  await configure({
7
18
  mounts: {
@@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path/posix';
3
3
  import { configureSingle, CopyOnWrite, InMemory, InMemoryStore, mounts, Readonly, StoreFS } from '@zenfs/core';
4
4
  import { S_IFDIR } from '@zenfs/core/constants';
5
- import { copySync, data } from '../setup.ts';
5
+ import { copySync, data } from '@zenfs/devel/tests/setup';
6
6
 
7
7
  copySync(data);
8
8
 
@@ -1,3 +1,3 @@
1
- import { copySync, data } from '../setup.ts';
1
+ import { copySync, data } from '@zenfs/devel/tests/setup';
2
2
 
3
3
  copySync(data);
@@ -1,7 +1,7 @@
1
1
  import { InMemory, Port, configureSingle, fs, resolveMountConfig, resolveRemoteMount, sync } from '@zenfs/core';
2
2
  import { after, afterEach } from 'node:test';
3
3
  import { MessageChannel } from 'node:worker_threads';
4
- import { copySync, data } from '../setup.ts';
4
+ import { copySync, data } from '@zenfs/devel/tests/setup';
5
5
 
6
6
  const { port1: localPort, port2: remotePort } = new MessageChannel();
7
7
 
@@ -1,5 +1,5 @@
1
1
  import { SingleBuffer, configureSingle } from '@zenfs/core';
2
- import { copySync, data } from '../setup.ts';
2
+ import { copySync, data } from '@zenfs/devel/tests/setup';
3
3
 
4
4
  await configureSingle({
5
5
  backend: SingleBuffer,
@@ -1,5 +1,5 @@
1
1
  import { SingleBuffer, configureSingle } from '@zenfs/core';
2
- import { copySync, data } from '../setup.ts';
2
+ import { copySync, data } from '@zenfs/devel/tests/setup';
3
3
 
4
4
  await configureSingle({
5
5
  backend: SingleBuffer,
package/tests/setup.ts CHANGED
@@ -4,12 +4,15 @@ import type { NodeFS } from '@zenfs/core/node/types';
4
4
  import { existsSync, mkdirSync, readFileSync, readdirSync, statSync } from 'node:fs';
5
5
  import { join, relative } from 'node:path';
6
6
 
7
+ /** @deprecated Use `@zenfs/devel/tests/setup` */
7
8
  export const data = join(import.meta.dirname, 'data');
8
9
 
10
+ /** @deprecated Use `@zenfs/devel/tests/setup` */
9
11
  export const tmp = join(import.meta.dirname, 'tmp');
10
12
 
11
13
  if (!existsSync(tmp)) mkdirSync(tmp, { recursive: true });
12
14
 
15
+ /** @deprecated Use `@zenfs/devel/tests/setup` */
13
16
  export async function copyAsync(_path: string, fs: NodeFS = _fs): Promise<void> {
14
17
  const path = relative(data, _path) || '/';
15
18
  const stats = statSync(_path);
@@ -27,6 +30,7 @@ export async function copyAsync(_path: string, fs: NodeFS = _fs): Promise<void>
27
30
  }
28
31
  }
29
32
 
33
+ /** @deprecated Use `@zenfs/devel/tests/setup` */
30
34
  export function copySync(_path: string, fs: NodeFS = _fs): void {
31
35
  const path = relative(data, _path) || '/';
32
36
  const stats = statSync(_path);
@@ -1,40 +0,0 @@
1
- import { existsSync, mkdirSync, readdirSync } from 'node:fs';
2
- import { createConnection } from 'node:net';
3
- import { join } from 'node:path';
4
-
5
- // Copied from setup.ts
6
-
7
- export const data = join(import.meta.dirname, '../data');
8
-
9
- export const defaultEntries = readdirSync(data);
10
-
11
- export const tmp = join(import.meta.dirname, '../tmp');
12
-
13
- if (!existsSync(tmp)) mkdirSync(tmp);
14
-
15
- export const port = 26514;
16
-
17
- export const baseUrl = 'http://localhost:' + port;
18
-
19
- export const indexPath = '/.index.json';
20
-
21
- export function whenServerReady() {
22
- const { promise, resolve, reject } = Promise.withResolvers();
23
-
24
- const timeout = setTimeout(reject, 10_000);
25
-
26
- const interval = setInterval(() => {
27
- const socket = createConnection(port)
28
- .on('connect', () => {
29
- socket.end();
30
- clearTimeout(timeout);
31
- clearInterval(interval);
32
- resolve();
33
- })
34
- .on('error', () => {
35
- // ignore
36
- });
37
- }, 250);
38
-
39
- return promise;
40
- }
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # Credit: Dave Dopson, https://stackoverflow.com/a/246128/17637456
4
- SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
5
-
6
- node $SCRIPT_DIR/server.js &
7
- PID=$!
8
-
9
- echo -en "Waiting for server to start...\r"
10
- if [ -n "$VERBOSE" ]; then echo; fi
11
- until nc -z localhost 26514; do
12
- sleep 0.25
13
- done
14
-
15
- npx --silent zenfs-test $SCRIPT_DIR/fetch.ts --preserve --force --node "$@"
16
-
17
- kill $PID