memfs 4.55.0 → 4.56.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.
- package/README.md +75 -2
- package/lib/fsa/index.d.ts +1 -33
- package/lib/fsa/index.js +1 -39
- package/lib/fsa/index.js.map +1 -1
- package/lib/fsa-to-node/index.d.ts +1 -2
- package/lib/fsa-to-node/index.js +2 -5
- package/lib/fsa-to-node/index.js.map +1 -1
- package/lib/index.d.ts +6 -7
- package/lib/index.js +10 -14
- package/lib/index.js.map +1 -1
- package/lib/node-to-fsa/index.d.ts +1 -7
- package/lib/node-to-fsa/index.js +1 -10
- package/lib/node-to-fsa/index.js.map +1 -1
- package/package.json +9 -3
- package/lib/constants.d.ts +0 -67
- package/lib/constants.js +0 -54
- package/lib/constants.js.map +0 -1
- package/lib/consts/AMODE.d.ts +0 -9
- package/lib/consts/AMODE.js +0 -3
- package/lib/consts/AMODE.js.map +0 -1
- package/lib/consts/FLAG.d.ts +0 -53
- package/lib/consts/FLAG.js +0 -36
- package/lib/consts/FLAG.js.map +0 -1
- package/lib/core/File.d.ts +0 -39
- package/lib/core/File.js +0 -72
- package/lib/core/File.js.map +0 -1
- package/lib/core/Link.d.ts +0 -38
- package/lib/core/Link.js +0 -105
- package/lib/core/Link.js.map +0 -1
- package/lib/core/Node.d.ts +0 -85
- package/lib/core/Node.js +0 -287
- package/lib/core/Node.js.map +0 -1
- package/lib/core/Superblock.d.ts +0 -92
- package/lib/core/Superblock.js +0 -689
- package/lib/core/Superblock.js.map +0 -1
- package/lib/core/constants.d.ts +0 -15
- package/lib/core/constants.js +0 -3
- package/lib/core/constants.js.map +0 -1
- package/lib/core/index.d.ts +0 -6
- package/lib/core/index.js +0 -15
- package/lib/core/index.js.map +0 -1
- package/lib/core/json.d.ts +0 -9
- package/lib/core/json.js +0 -35
- package/lib/core/json.js.map +0 -1
- package/lib/core/result.d.ts +0 -11
- package/lib/core/result.js +0 -11
- package/lib/core/result.js.map +0 -1
- package/lib/core/types.d.ts +0 -8
- package/lib/core/types.js +0 -3
- package/lib/core/types.js.map +0 -1
- package/lib/core/util.d.ts +0 -12
- package/lib/core/util.js +0 -74
- package/lib/core/util.js.map +0 -1
- package/lib/encoding.d.ts +0 -6
- package/lib/encoding.js +0 -20
- package/lib/encoding.js.map +0 -1
- package/lib/fsa/CoreFileSystemDirectoryHandle.d.ts +0 -73
- package/lib/fsa/CoreFileSystemDirectoryHandle.js +0 -265
- package/lib/fsa/CoreFileSystemDirectoryHandle.js.map +0 -1
- package/lib/fsa/CoreFileSystemFileHandle.d.ts +0 -25
- package/lib/fsa/CoreFileSystemFileHandle.js +0 -75
- package/lib/fsa/CoreFileSystemFileHandle.js.map +0 -1
- package/lib/fsa/CoreFileSystemHandle.d.ts +0 -34
- package/lib/fsa/CoreFileSystemHandle.js +0 -53
- package/lib/fsa/CoreFileSystemHandle.js.map +0 -1
- package/lib/fsa/CoreFileSystemObserver.d.ts +0 -10
- package/lib/fsa/CoreFileSystemObserver.js +0 -18
- package/lib/fsa/CoreFileSystemObserver.js.map +0 -1
- package/lib/fsa/CoreFileSystemSyncAccessHandle.d.ts +0 -38
- package/lib/fsa/CoreFileSystemSyncAccessHandle.js +0 -123
- package/lib/fsa/CoreFileSystemSyncAccessHandle.js.map +0 -1
- package/lib/fsa/CoreFileSystemWritableFileStream.d.ts +0 -32
- package/lib/fsa/CoreFileSystemWritableFileStream.js +0 -163
- package/lib/fsa/CoreFileSystemWritableFileStream.js.map +0 -1
- package/lib/fsa/CorePermissionStatus.d.ts +0 -9
- package/lib/fsa/CorePermissionStatus.js +0 -14
- package/lib/fsa/CorePermissionStatus.js.map +0 -1
- package/lib/fsa/FileLockManager.d.ts +0 -7
- package/lib/fsa/FileLockManager.js +0 -26
- package/lib/fsa/FileLockManager.js.map +0 -1
- package/lib/fsa/types.d.ts +0 -182
- package/lib/fsa/types.js +0 -3
- package/lib/fsa/types.js.map +0 -1
- package/lib/fsa/util.d.ts +0 -12
- package/lib/fsa/util.js +0 -45
- package/lib/fsa/util.js.map +0 -1
- package/lib/fsa-to-node/FsaNodeCore.d.ts +0 -33
- package/lib/fsa-to-node/FsaNodeCore.js +0 -191
- package/lib/fsa-to-node/FsaNodeCore.js.map +0 -1
- package/lib/fsa-to-node/FsaNodeDirent.d.ts +0 -19
- package/lib/fsa-to-node/FsaNodeDirent.js +0 -39
- package/lib/fsa-to-node/FsaNodeDirent.js.map +0 -1
- package/lib/fsa-to-node/FsaNodeFs.d.ts +0 -187
- package/lib/fsa-to-node/FsaNodeFs.js +0 -831
- package/lib/fsa-to-node/FsaNodeFs.js.map +0 -1
- package/lib/fsa-to-node/FsaNodeFsOpenFile.d.ts +0 -24
- package/lib/fsa-to-node/FsaNodeFsOpenFile.js +0 -37
- package/lib/fsa-to-node/FsaNodeFsOpenFile.js.map +0 -1
- package/lib/fsa-to-node/FsaNodeReadStream.d.ts +0 -23
- package/lib/fsa-to-node/FsaNodeReadStream.js +0 -92
- package/lib/fsa-to-node/FsaNodeReadStream.js.map +0 -1
- package/lib/fsa-to-node/FsaNodeStats.d.ts +0 -30
- package/lib/fsa-to-node/FsaNodeStats.js +0 -53
- package/lib/fsa-to-node/FsaNodeStats.js.map +0 -1
- package/lib/fsa-to-node/FsaNodeWriteStream.d.ts +0 -47
- package/lib/fsa-to-node/FsaNodeWriteStream.js +0 -150
- package/lib/fsa-to-node/FsaNodeWriteStream.js.map +0 -1
- package/lib/fsa-to-node/constants.d.ts +0 -3
- package/lib/fsa-to-node/constants.js +0 -3
- package/lib/fsa-to-node/constants.js.map +0 -1
- package/lib/fsa-to-node/json.d.ts +0 -2
- package/lib/fsa-to-node/json.js +0 -7
- package/lib/fsa-to-node/json.js.map +0 -1
- package/lib/fsa-to-node/types.d.ts +0 -37
- package/lib/fsa-to-node/types.js +0 -3
- package/lib/fsa-to-node/types.js.map +0 -1
- package/lib/fsa-to-node/util.d.ts +0 -4
- package/lib/fsa-to-node/util.js +0 -34
- package/lib/fsa-to-node/util.js.map +0 -1
- package/lib/fsa-to-node/worker/FsaNodeSyncAdapterWorker.d.ts +0 -10
- package/lib/fsa-to-node/worker/FsaNodeSyncAdapterWorker.js +0 -62
- package/lib/fsa-to-node/worker/FsaNodeSyncAdapterWorker.js.map +0 -1
- package/lib/fsa-to-node/worker/FsaNodeSyncWorker.d.ts +0 -20
- package/lib/fsa-to-node/worker/FsaNodeSyncWorker.js +0 -178
- package/lib/fsa-to-node/worker/FsaNodeSyncWorker.js.map +0 -1
- package/lib/fsa-to-node/worker/SyncMessenger.d.ts +0 -24
- package/lib/fsa-to-node/worker/SyncMessenger.js +0 -72
- package/lib/fsa-to-node/worker/SyncMessenger.js.map +0 -1
- package/lib/fsa-to-node/worker/constants.d.ts +0 -8
- package/lib/fsa-to-node/worker/constants.js +0 -3
- package/lib/fsa-to-node/worker/constants.js.map +0 -1
- package/lib/fsa-to-node/worker/types.d.ts +0 -17
- package/lib/fsa-to-node/worker/types.js +0 -3
- package/lib/fsa-to-node/worker/types.js.map +0 -1
- package/lib/node/Dir.d.ts +0 -26
- package/lib/node/Dir.js +0 -186
- package/lib/node/Dir.js.map +0 -1
- package/lib/node/Dirent.d.ts +0 -26
- package/lib/node/Dirent.js +0 -57
- package/lib/node/Dirent.js.map +0 -1
- package/lib/node/FileHandle.d.ts +0 -52
- package/lib/node/FileHandle.js +0 -189
- package/lib/node/FileHandle.js.map +0 -1
- package/lib/node/FsPromises.d.ts +0 -91
- package/lib/node/FsPromises.js +0 -161
- package/lib/node/FsPromises.js.map +0 -1
- package/lib/node/StatFs.d.ts +0 -19
- package/lib/node/StatFs.js +0 -34
- package/lib/node/StatFs.js.map +0 -1
- package/lib/node/Stats.d.ts +0 -41
- package/lib/node/Stats.js +0 -72
- package/lib/node/Stats.js.map +0 -1
- package/lib/node/constants.d.ts +0 -41
- package/lib/node/constants.js +0 -57
- package/lib/node/constants.js.map +0 -1
- package/lib/node/glob.d.ts +0 -5
- package/lib/node/glob.js +0 -94
- package/lib/node/glob.js.map +0 -1
- package/lib/node/lists/fsCallbackApiList.d.ts +0 -2
- package/lib/node/lists/fsCallbackApiList.js +0 -55
- package/lib/node/lists/fsCallbackApiList.js.map +0 -1
- package/lib/node/lists/fsCommonObjectsList.d.ts +0 -2
- package/lib/node/lists/fsCommonObjectsList.js +0 -19
- package/lib/node/lists/fsCommonObjectsList.js.map +0 -1
- package/lib/node/lists/fsSynchronousApiList.d.ts +0 -2
- package/lib/node/lists/fsSynchronousApiList.js +0 -49
- package/lib/node/lists/fsSynchronousApiList.js.map +0 -1
- package/lib/node/options.d.ts +0 -27
- package/lib/node/options.js +0 -112
- package/lib/node/options.js.map +0 -1
- package/lib/node/types/FsCallbackApi.d.ts +0 -143
- package/lib/node/types/FsCallbackApi.js +0 -3
- package/lib/node/types/FsCallbackApi.js.map +0 -1
- package/lib/node/types/FsCommonObjects.d.ts +0 -17
- package/lib/node/types/FsCommonObjects.js +0 -3
- package/lib/node/types/FsCommonObjects.js.map +0 -1
- package/lib/node/types/FsPromisesApi.d.ts +0 -41
- package/lib/node/types/FsPromisesApi.js +0 -3
- package/lib/node/types/FsPromisesApi.js.map +0 -1
- package/lib/node/types/FsSynchronousApi.d.ts +0 -114
- package/lib/node/types/FsSynchronousApi.js +0 -3
- package/lib/node/types/FsSynchronousApi.js.map +0 -1
- package/lib/node/types/index.d.ts +0 -7
- package/lib/node/types/index.js +0 -3
- package/lib/node/types/index.js.map +0 -1
- package/lib/node/types/misc.d.ts +0 -157
- package/lib/node/types/misc.js +0 -3
- package/lib/node/types/misc.js.map +0 -1
- package/lib/node/types/options.d.ts +0 -191
- package/lib/node/types/options.js +0 -3
- package/lib/node/types/options.js.map +0 -1
- package/lib/node/util.d.ts +0 -21
- package/lib/node/util.js +0 -297
- package/lib/node/util.js.map +0 -1
- package/lib/node/volume.d.ts +0 -395
- package/lib/node/volume.js +0 -1641
- package/lib/node/volume.js.map +0 -1
- package/lib/node-to-fsa/NodeFileSystemDirectoryHandle.d.ts +0 -72
- package/lib/node-to-fsa/NodeFileSystemDirectoryHandle.js +0 -217
- package/lib/node-to-fsa/NodeFileSystemDirectoryHandle.js.map +0 -1
- package/lib/node-to-fsa/NodeFileSystemFileHandle.d.ts +0 -28
- package/lib/node-to-fsa/NodeFileSystemFileHandle.js +0 -70
- package/lib/node-to-fsa/NodeFileSystemFileHandle.js.map +0 -1
- package/lib/node-to-fsa/NodeFileSystemHandle.d.ts +0 -37
- package/lib/node-to-fsa/NodeFileSystemHandle.js +0 -68
- package/lib/node-to-fsa/NodeFileSystemHandle.js.map +0 -1
- package/lib/node-to-fsa/NodeFileSystemSyncAccessHandle.d.ts +0 -42
- package/lib/node-to-fsa/NodeFileSystemSyncAccessHandle.js +0 -97
- package/lib/node-to-fsa/NodeFileSystemSyncAccessHandle.js.map +0 -1
- package/lib/node-to-fsa/NodeFileSystemWritableFileStream.d.ts +0 -56
- package/lib/node-to-fsa/NodeFileSystemWritableFileStream.js +0 -191
- package/lib/node-to-fsa/NodeFileSystemWritableFileStream.js.map +0 -1
- package/lib/node-to-fsa/NodePermissionStatus.d.ts +0 -8
- package/lib/node-to-fsa/NodePermissionStatus.js +0 -14
- package/lib/node-to-fsa/NodePermissionStatus.js.map +0 -1
- package/lib/node-to-fsa/types.d.ts +0 -18
- package/lib/node-to-fsa/types.js +0 -3
- package/lib/node-to-fsa/types.js.map +0 -1
- package/lib/node-to-fsa/util.d.ts +0 -12
- package/lib/node-to-fsa/util.js +0 -45
- package/lib/node-to-fsa/util.js.map +0 -1
- package/lib/node.d.ts +0 -3
- package/lib/node.js +0 -10
- package/lib/node.js.map +0 -1
- package/lib/print/index.d.ts +0 -9
- package/lib/print/index.js +0 -49
- package/lib/print/index.js.map +0 -1
- package/lib/process.d.ts +0 -11
- package/lib/process.js +0 -40
- package/lib/process.js.map +0 -1
- package/lib/queueMicrotask.d.ts +0 -2
- package/lib/queueMicrotask.js +0 -6
- package/lib/queueMicrotask.js.map +0 -1
- package/lib/snapshot/async.d.ts +0 -3
- package/lib/snapshot/async.js +0 -59
- package/lib/snapshot/async.js.map +0 -1
- package/lib/snapshot/binary.d.ts +0 -6
- package/lib/snapshot/binary.js +0 -31
- package/lib/snapshot/binary.js.map +0 -1
- package/lib/snapshot/constants.d.ts +0 -5
- package/lib/snapshot/constants.js +0 -3
- package/lib/snapshot/constants.js.map +0 -1
- package/lib/snapshot/index.d.ts +0 -5
- package/lib/snapshot/index.js +0 -8
- package/lib/snapshot/index.js.map +0 -1
- package/lib/snapshot/json.d.ts +0 -10
- package/lib/snapshot/json.js +0 -31
- package/lib/snapshot/json.js.map +0 -1
- package/lib/snapshot/shared.d.ts +0 -2
- package/lib/snapshot/shared.js +0 -6
- package/lib/snapshot/shared.js.map +0 -1
- package/lib/snapshot/sync.d.ts +0 -3
- package/lib/snapshot/sync.js +0 -59
- package/lib/snapshot/sync.js.map +0 -1
- package/lib/snapshot/types.d.ts +0 -30
- package/lib/snapshot/types.js +0 -3
- package/lib/snapshot/types.js.map +0 -1
- package/lib/vendor/node/buffer.d.ts +0 -1
- package/lib/vendor/node/buffer.js +0 -6
- package/lib/vendor/node/buffer.js.map +0 -1
- package/lib/vendor/node/events.d.ts +0 -1
- package/lib/vendor/node/events.js +0 -6
- package/lib/vendor/node/events.js.map +0 -1
- package/lib/vendor/node/fs.d.ts +0 -6
- package/lib/vendor/node/fs.js +0 -4
- package/lib/vendor/node/fs.js.map +0 -1
- package/lib/vendor/node/internal/buffer.d.ts +0 -9
- package/lib/vendor/node/internal/buffer.js +0 -13
- package/lib/vendor/node/internal/buffer.js.map +0 -1
- package/lib/vendor/node/internal/errors.d.ts +0 -31
- package/lib/vendor/node/internal/errors.js +0 -77
- package/lib/vendor/node/internal/errors.js.map +0 -1
- package/lib/vendor/node/path.d.ts +0 -1
- package/lib/vendor/node/path.js +0 -14
- package/lib/vendor/node/path.js.map +0 -1
- package/lib/vendor/node/stream.d.ts +0 -1
- package/lib/vendor/node/stream.js +0 -7
- package/lib/vendor/node/stream.js.map +0 -1
- package/lib/vendor/node/url.d.ts +0 -1
- package/lib/vendor/node/url.js +0 -6
- package/lib/vendor/node/url.js.map +0 -1
- package/lib/vendor/node/util.d.ts +0 -20
- package/lib/vendor/node/util.js +0 -112
- package/lib/vendor/node/util.js.map +0 -1
- package/src/node-to-fsa/README.md +0 -5
package/README.md
CHANGED
|
@@ -1,3 +1,76 @@
|
|
|
1
|
-
#
|
|
1
|
+
# memfs
|
|
2
2
|
|
|
3
|
-
In-memory file
|
|
3
|
+
In-memory file system with Node.js `fs` API and browser File System (Access) API.
|
|
4
|
+
|
|
5
|
+
[![npm][npm-badge]][npm-url]
|
|
6
|
+
|
|
7
|
+
[npm-badge]: https://img.shields.io/npm/v/memfs.svg
|
|
8
|
+
[npm-url]: https://www.npmjs.com/package/memfs
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
`memfs` is a JavaScript library that implements an in-memory file system compatible with Node.js `fs` module and the browser File System (Access) API. Use it for testing, mocking file systems, or creating virtual file systems in both Node.js and browser environments.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install memfs
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
### Node.js `fs` API
|
|
23
|
+
|
|
24
|
+
```javascript
|
|
25
|
+
import { fs } from 'memfs';
|
|
26
|
+
|
|
27
|
+
// Write a file
|
|
28
|
+
fs.writeFileSync('/hello.txt', 'Hello, World!');
|
|
29
|
+
|
|
30
|
+
// Read a file
|
|
31
|
+
const content = fs.readFileSync('/hello.txt', 'utf-8');
|
|
32
|
+
console.log(content); // "Hello, World!"
|
|
33
|
+
|
|
34
|
+
// Create a directory
|
|
35
|
+
fs.mkdirSync('/mydir');
|
|
36
|
+
|
|
37
|
+
// List directory contents
|
|
38
|
+
console.log(fs.readdirSync('/')); // ['hello.txt', 'mydir']
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Browser File System API
|
|
42
|
+
|
|
43
|
+
```javascript
|
|
44
|
+
import { fsa } from 'memfs';
|
|
45
|
+
|
|
46
|
+
// Get root directory handle
|
|
47
|
+
const root = await fsa.getRoot();
|
|
48
|
+
|
|
49
|
+
// Create a file
|
|
50
|
+
const file = await root.getFileHandle('hello.txt', { create: true });
|
|
51
|
+
const writable = await file.createWritable();
|
|
52
|
+
await writable.write('Hello, World!');
|
|
53
|
+
await writable.close();
|
|
54
|
+
|
|
55
|
+
// Read the file
|
|
56
|
+
const readable = await file.getFile();
|
|
57
|
+
const text = await readable.text();
|
|
58
|
+
console.log(text); // "Hello, World!"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Features
|
|
62
|
+
|
|
63
|
+
- Node.js `fs` module API compatibility
|
|
64
|
+
- Browser File System (Access) API implementation
|
|
65
|
+
- Adapters between `fs` and File System API
|
|
66
|
+
- Directory snapshots and tree printing utilities
|
|
67
|
+
- Works in Node.js and modern browsers
|
|
68
|
+
- TypeScript support
|
|
69
|
+
|
|
70
|
+
## Documentation
|
|
71
|
+
|
|
72
|
+
For detailed documentation and more examples, visit the [main project page](https://github.com/streamich/memfs).
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
Apache 2.0
|
package/lib/fsa/index.d.ts
CHANGED
|
@@ -1,33 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { CoreFsaContext, IFileSystemObserverConstructable } from './types';
|
|
3
|
-
import { Superblock } from '../core/Superblock';
|
|
4
|
-
export * from './types';
|
|
5
|
-
export * from './CoreFileSystemHandle';
|
|
6
|
-
export * from './CoreFileSystemDirectoryHandle';
|
|
7
|
-
export * from './CoreFileSystemFileHandle';
|
|
8
|
-
export * from './CoreFileSystemSyncAccessHandle';
|
|
9
|
-
export * from './CoreFileSystemWritableFileStream';
|
|
10
|
-
export * from './CoreFileSystemObserver';
|
|
11
|
-
export * from './CorePermissionStatus';
|
|
12
|
-
export * from './FileLockManager';
|
|
13
|
-
/**
|
|
14
|
-
* Create a new instance of an in-memory File System Access API
|
|
15
|
-
* implementation rooted at the root directory of the filesystem.
|
|
16
|
-
*
|
|
17
|
-
* @param ctx Optional context for the File System Access API.
|
|
18
|
-
* @param core Optional low-level file system implementation to
|
|
19
|
-
* back the File System Access API. If not provided, a new empty
|
|
20
|
-
* Superblock instance will be created.
|
|
21
|
-
* @param dirPath Optional path within the filesystem to use as the root
|
|
22
|
-
* directory of the File System Access API. Defaults to `/`.
|
|
23
|
-
* @returns A File System Access API implementation `dir` rooted at
|
|
24
|
-
* the root directory of the filesystem, as well as the `core`,
|
|
25
|
-
* a low-level file system implementation itself. Also, returns
|
|
26
|
-
* `FileSystemObserver`, a class that can be used to create
|
|
27
|
-
* observers that watch for changes to files and directories.
|
|
28
|
-
*/
|
|
29
|
-
export declare const fsa: (ctx?: Partial<CoreFsaContext>, core?: Superblock, dirPath?: string) => {
|
|
30
|
-
core: Superblock;
|
|
31
|
-
dir: CoreFileSystemDirectoryHandle;
|
|
32
|
-
FileSystemObserver: IFileSystemObserverConstructable;
|
|
33
|
-
};
|
|
1
|
+
export * from '@jsonjoy.com/fs-fsa';
|
package/lib/fsa/index.js
CHANGED
|
@@ -1,43 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fsa = void 0;
|
|
4
3
|
const tslib_1 = require("tslib");
|
|
5
|
-
|
|
6
|
-
const Superblock_1 = require("../core/Superblock");
|
|
7
|
-
const CoreFileSystemObserver_1 = require("./CoreFileSystemObserver");
|
|
8
|
-
tslib_1.__exportStar(require("./types"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./CoreFileSystemHandle"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./CoreFileSystemDirectoryHandle"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./CoreFileSystemFileHandle"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./CoreFileSystemSyncAccessHandle"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./CoreFileSystemWritableFileStream"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./CoreFileSystemObserver"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./CorePermissionStatus"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./FileLockManager"), exports);
|
|
17
|
-
/**
|
|
18
|
-
* Create a new instance of an in-memory File System Access API
|
|
19
|
-
* implementation rooted at the root directory of the filesystem.
|
|
20
|
-
*
|
|
21
|
-
* @param ctx Optional context for the File System Access API.
|
|
22
|
-
* @param core Optional low-level file system implementation to
|
|
23
|
-
* back the File System Access API. If not provided, a new empty
|
|
24
|
-
* Superblock instance will be created.
|
|
25
|
-
* @param dirPath Optional path within the filesystem to use as the root
|
|
26
|
-
* directory of the File System Access API. Defaults to `/`.
|
|
27
|
-
* @returns A File System Access API implementation `dir` rooted at
|
|
28
|
-
* the root directory of the filesystem, as well as the `core`,
|
|
29
|
-
* a low-level file system implementation itself. Also, returns
|
|
30
|
-
* `FileSystemObserver`, a class that can be used to create
|
|
31
|
-
* observers that watch for changes to files and directories.
|
|
32
|
-
*/
|
|
33
|
-
const fsa = (ctx, core = new Superblock_1.Superblock(), dirPath = '/') => {
|
|
34
|
-
const dir = new CoreFileSystemDirectoryHandle_1.CoreFileSystemDirectoryHandle(core, dirPath, ctx);
|
|
35
|
-
const FileSystemObserver = class FileSystemObserver extends CoreFileSystemObserver_1.CoreFileSystemObserver {
|
|
36
|
-
constructor(callback) {
|
|
37
|
-
super(core, callback);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
return { core, dir, FileSystemObserver };
|
|
41
|
-
};
|
|
42
|
-
exports.fsa = fsa;
|
|
4
|
+
tslib_1.__exportStar(require("@jsonjoy.com/fs-fsa"), exports);
|
|
43
5
|
//# sourceMappingURL=index.js.map
|
package/lib/fsa/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fsa/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fsa/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { FsaNodeSyncAdapterWorker } from './worker/FsaNodeSyncAdapterWorker';
|
|
1
|
+
export * from '@jsonjoy.com/fs-fsa-to-node';
|
package/lib/fsa-to-node/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "FsaNodeFs", { enumerable: true, get: function () { return FsaNodeFs_1.FsaNodeFs; } });
|
|
6
|
-
var FsaNodeSyncAdapterWorker_1 = require("./worker/FsaNodeSyncAdapterWorker");
|
|
7
|
-
Object.defineProperty(exports, "FsaNodeSyncAdapterWorker", { enumerable: true, get: function () { return FsaNodeSyncAdapterWorker_1.FsaNodeSyncAdapterWorker; } });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("@jsonjoy.com/fs-fsa-to-node"), exports);
|
|
8
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fsa-to-node/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fsa-to-node/index.ts"],"names":[],"mappings":";;;AAAA,sEAA4C"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import Stats from '
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import type
|
|
7
|
-
import type * as misc from './node/types/misc';
|
|
1
|
+
import { Stats, Dirent, Volume, StatWatcher, FSWatcher } from '@jsonjoy.com/fs-node';
|
|
2
|
+
import type { IWriteStream } from '@jsonjoy.com/fs-node';
|
|
3
|
+
import { DirectoryJSON, NestedDirectoryJSON } from '@jsonjoy.com/fs-core';
|
|
4
|
+
import { constants } from '@jsonjoy.com/fs-node-utils';
|
|
5
|
+
import type { FsPromisesApi } from '@jsonjoy.com/fs-node-utils';
|
|
6
|
+
import type * as misc from '@jsonjoy.com/fs-node-utils/lib/types/misc';
|
|
8
7
|
export { DirectoryJSON, NestedDirectoryJSON, Volume };
|
|
9
8
|
export declare const vol: Volume;
|
|
10
9
|
export interface IFs extends Volume {
|
package/lib/index.js
CHANGED
|
@@ -2,23 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.memfs = exports.fs = exports.vol = exports.Volume = void 0;
|
|
4
4
|
exports.createFsFromVolume = createFsFromVolume;
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const constants_1 = require("./constants");
|
|
10
|
-
const fsSynchronousApiList_1 = require("./node/lists/fsSynchronousApiList");
|
|
11
|
-
const fsCallbackApiList_1 = require("./node/lists/fsCallbackApiList");
|
|
12
|
-
const { F_OK, R_OK, W_OK, X_OK } = constants_1.constants;
|
|
5
|
+
const fs_node_1 = require("@jsonjoy.com/fs-node");
|
|
6
|
+
Object.defineProperty(exports, "Volume", { enumerable: true, get: function () { return fs_node_1.Volume; } });
|
|
7
|
+
const fs_node_utils_1 = require("@jsonjoy.com/fs-node-utils");
|
|
8
|
+
const { F_OK, R_OK, W_OK, X_OK } = fs_node_utils_1.constants;
|
|
13
9
|
// Default volume.
|
|
14
|
-
exports.vol = new
|
|
10
|
+
exports.vol = new fs_node_1.Volume();
|
|
15
11
|
function createFsFromVolume(vol) {
|
|
16
|
-
const fs = { F_OK, R_OK, W_OK, X_OK, constants:
|
|
12
|
+
const fs = { F_OK, R_OK, W_OK, X_OK, constants: fs_node_utils_1.constants, Stats: fs_node_1.Stats, Dirent: fs_node_1.Dirent };
|
|
17
13
|
// Bind FS methods.
|
|
18
|
-
for (const method of
|
|
14
|
+
for (const method of fs_node_1.fsSynchronousApiList)
|
|
19
15
|
if (typeof vol[method] === 'function')
|
|
20
16
|
fs[method] = vol[method].bind(vol);
|
|
21
|
-
for (const method of
|
|
17
|
+
for (const method of fs_node_1.fsCallbackApiList)
|
|
22
18
|
if (typeof vol[method] === 'function')
|
|
23
19
|
fs[method] = vol[method].bind(vol);
|
|
24
20
|
fs.StatWatcher = vol.StatWatcher;
|
|
@@ -39,7 +35,7 @@ function createFsFromVolume(vol) {
|
|
|
39
35
|
fs.realpathSync.native = vol.realpathSync.native.bind(vol);
|
|
40
36
|
}
|
|
41
37
|
}
|
|
42
|
-
fs._toUnixTimestamp =
|
|
38
|
+
fs._toUnixTimestamp = fs_node_1.toUnixTimestamp;
|
|
43
39
|
fs.__vol = vol;
|
|
44
40
|
return fs;
|
|
45
41
|
}
|
|
@@ -55,7 +51,7 @@ exports.fs = createFsFromVolume(exports.vol);
|
|
|
55
51
|
* the `fs` module.
|
|
56
52
|
*/
|
|
57
53
|
const memfs = (json = {}, cwd = '/') => {
|
|
58
|
-
const vol =
|
|
54
|
+
const vol = fs_node_1.Volume.fromNestedJSON(json, cwd);
|
|
59
55
|
const fs = createFsFromVolume(vol);
|
|
60
56
|
return { fs, vol };
|
|
61
57
|
};
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { NodeFsaContext, NodeFsaFs } from './types';
|
|
3
|
-
export * from './types';
|
|
4
|
-
export * from './NodeFileSystemHandle';
|
|
5
|
-
export * from './NodeFileSystemDirectoryHandle';
|
|
6
|
-
export * from './NodeFileSystemFileHandle';
|
|
7
|
-
export declare const nodeToFsa: (fs: NodeFsaFs, dirPath: string, ctx?: Partial<NodeFsaContext>) => NodeFileSystemDirectoryHandle;
|
|
1
|
+
export * from '@jsonjoy.com/fs-node-to-fsa';
|
package/lib/node-to-fsa/index.js
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.nodeToFsa = void 0;
|
|
4
3
|
const tslib_1 = require("tslib");
|
|
5
|
-
|
|
6
|
-
tslib_1.__exportStar(require("./types"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./NodeFileSystemHandle"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./NodeFileSystemDirectoryHandle"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./NodeFileSystemFileHandle"), exports);
|
|
10
|
-
const nodeToFsa = (fs, dirPath, ctx) => {
|
|
11
|
-
return new NodeFileSystemDirectoryHandle_1.NodeFileSystemDirectoryHandle(fs, dirPath, ctx);
|
|
12
|
-
};
|
|
13
|
-
exports.nodeToFsa = nodeToFsa;
|
|
4
|
+
tslib_1.__exportStar(require("@jsonjoy.com/fs-node-to-fsa"), exports);
|
|
14
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node-to-fsa/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node-to-fsa/index.ts"],"names":[],"mappings":";;;AAAA,sEAA4C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memfs",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.56.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -127,9 +127,15 @@
|
|
|
127
127
|
"tslib": "2"
|
|
128
128
|
},
|
|
129
129
|
"dependencies": {
|
|
130
|
+
"@jsonjoy.com/fs-core": "4.56.2",
|
|
131
|
+
"@jsonjoy.com/fs-fsa": "4.56.2",
|
|
132
|
+
"@jsonjoy.com/fs-node": "4.56.2",
|
|
133
|
+
"@jsonjoy.com/fs-node-builtins": "4.56.2",
|
|
134
|
+
"@jsonjoy.com/fs-node-to-fsa": "4.56.2",
|
|
135
|
+
"@jsonjoy.com/fs-node-utils": "4.56.2",
|
|
136
|
+
"@jsonjoy.com/fs-print": "4.56.2",
|
|
137
|
+
"@jsonjoy.com/fs-snapshot": "^4.56.2",
|
|
130
138
|
"@jsonjoy.com/json-pack": "^1.11.0",
|
|
131
|
-
"@jsonjoy.com/node-fs-dependencies": "4.55.0",
|
|
132
|
-
"@jsonjoy.com/node-fs-utils": "4.55.0",
|
|
133
139
|
"@jsonjoy.com/util": "^1.9.0",
|
|
134
140
|
"glob-to-regex.js": "^1.0.1",
|
|
135
141
|
"thingies": "^2.5.0",
|
package/lib/constants.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
export declare const SEP = "/";
|
|
2
|
-
export declare const enum PATH {
|
|
3
|
-
SEP = "/"
|
|
4
|
-
}
|
|
5
|
-
export declare const constants: {
|
|
6
|
-
O_RDONLY: number;
|
|
7
|
-
O_WRONLY: number;
|
|
8
|
-
O_RDWR: number;
|
|
9
|
-
S_IFMT: number;
|
|
10
|
-
S_IFREG: number;
|
|
11
|
-
S_IFDIR: number;
|
|
12
|
-
S_IFCHR: number;
|
|
13
|
-
S_IFBLK: number;
|
|
14
|
-
S_IFIFO: number;
|
|
15
|
-
S_IFLNK: number;
|
|
16
|
-
S_IFSOCK: number;
|
|
17
|
-
O_CREAT: number;
|
|
18
|
-
O_EXCL: number;
|
|
19
|
-
O_NOCTTY: number;
|
|
20
|
-
O_TRUNC: number;
|
|
21
|
-
O_APPEND: number;
|
|
22
|
-
O_DIRECTORY: number;
|
|
23
|
-
O_NOATIME: number;
|
|
24
|
-
O_NOFOLLOW: number;
|
|
25
|
-
O_SYNC: number;
|
|
26
|
-
O_SYMLINK: number;
|
|
27
|
-
O_DIRECT: number;
|
|
28
|
-
O_NONBLOCK: number;
|
|
29
|
-
S_IRWXU: number;
|
|
30
|
-
S_IRUSR: number;
|
|
31
|
-
S_IWUSR: number;
|
|
32
|
-
S_IXUSR: number;
|
|
33
|
-
S_IRWXG: number;
|
|
34
|
-
S_IRGRP: number;
|
|
35
|
-
S_IWGRP: number;
|
|
36
|
-
S_IXGRP: number;
|
|
37
|
-
S_IRWXO: number;
|
|
38
|
-
S_IROTH: number;
|
|
39
|
-
S_IWOTH: number;
|
|
40
|
-
S_IXOTH: number;
|
|
41
|
-
F_OK: number;
|
|
42
|
-
R_OK: number;
|
|
43
|
-
W_OK: number;
|
|
44
|
-
X_OK: number;
|
|
45
|
-
UV_FS_SYMLINK_DIR: number;
|
|
46
|
-
UV_FS_SYMLINK_JUNCTION: number;
|
|
47
|
-
UV_FS_COPYFILE_EXCL: number;
|
|
48
|
-
UV_FS_COPYFILE_FICLONE: number;
|
|
49
|
-
UV_FS_COPYFILE_FICLONE_FORCE: number;
|
|
50
|
-
COPYFILE_EXCL: number;
|
|
51
|
-
COPYFILE_FICLONE: number;
|
|
52
|
-
COPYFILE_FICLONE_FORCE: number;
|
|
53
|
-
};
|
|
54
|
-
export declare const enum S {
|
|
55
|
-
ISUID = 2048,// (04000) set-user-ID (set process effective user ID on execve(2))
|
|
56
|
-
ISGID = 1024,// (02000) set-group-ID (set process effective group ID on execve(2); mandatory locking, as described in fcntl(2); take a new file's group from parent directory, as described in chown(2) and mkdir(2))
|
|
57
|
-
ISVTX = 512,// (01000) sticky bit (restricted deletion flag, as described in unlink(2))
|
|
58
|
-
IRUSR = 256,// (00400) read by owner
|
|
59
|
-
IWUSR = 128,// (00200) write by owner
|
|
60
|
-
IXUSR = 64,// (00100) execute/search by owner
|
|
61
|
-
IRGRP = 32,// (00040) read by group
|
|
62
|
-
IWGRP = 16,// (00020) write by group
|
|
63
|
-
IXGRP = 8,// (00010) execute/search by group
|
|
64
|
-
IROTH = 4,// (00004) read by others
|
|
65
|
-
IWOTH = 2,// (00002) write by others
|
|
66
|
-
IXOTH = 1
|
|
67
|
-
}
|
package/lib/constants.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.constants = exports.SEP = void 0;
|
|
4
|
-
exports.SEP = '/';
|
|
5
|
-
exports.constants = {
|
|
6
|
-
O_RDONLY: 0,
|
|
7
|
-
O_WRONLY: 1,
|
|
8
|
-
O_RDWR: 2,
|
|
9
|
-
S_IFMT: 61440,
|
|
10
|
-
S_IFREG: 32768,
|
|
11
|
-
S_IFDIR: 16384,
|
|
12
|
-
S_IFCHR: 8192,
|
|
13
|
-
S_IFBLK: 24576,
|
|
14
|
-
S_IFIFO: 4096,
|
|
15
|
-
S_IFLNK: 40960,
|
|
16
|
-
S_IFSOCK: 49152,
|
|
17
|
-
O_CREAT: 64,
|
|
18
|
-
O_EXCL: 128,
|
|
19
|
-
O_NOCTTY: 256,
|
|
20
|
-
O_TRUNC: 512,
|
|
21
|
-
O_APPEND: 1024,
|
|
22
|
-
O_DIRECTORY: 65536,
|
|
23
|
-
O_NOATIME: 262144,
|
|
24
|
-
O_NOFOLLOW: 131072,
|
|
25
|
-
O_SYNC: 1052672,
|
|
26
|
-
O_SYMLINK: 2097152,
|
|
27
|
-
O_DIRECT: 16384,
|
|
28
|
-
O_NONBLOCK: 2048,
|
|
29
|
-
S_IRWXU: 448,
|
|
30
|
-
S_IRUSR: 256,
|
|
31
|
-
S_IWUSR: 128,
|
|
32
|
-
S_IXUSR: 64,
|
|
33
|
-
S_IRWXG: 56,
|
|
34
|
-
S_IRGRP: 32,
|
|
35
|
-
S_IWGRP: 16,
|
|
36
|
-
S_IXGRP: 8,
|
|
37
|
-
S_IRWXO: 7,
|
|
38
|
-
S_IROTH: 4,
|
|
39
|
-
S_IWOTH: 2,
|
|
40
|
-
S_IXOTH: 1,
|
|
41
|
-
F_OK: 0,
|
|
42
|
-
R_OK: 4,
|
|
43
|
-
W_OK: 2,
|
|
44
|
-
X_OK: 1,
|
|
45
|
-
UV_FS_SYMLINK_DIR: 1,
|
|
46
|
-
UV_FS_SYMLINK_JUNCTION: 2,
|
|
47
|
-
UV_FS_COPYFILE_EXCL: 1,
|
|
48
|
-
UV_FS_COPYFILE_FICLONE: 2,
|
|
49
|
-
UV_FS_COPYFILE_FICLONE_FORCE: 4,
|
|
50
|
-
COPYFILE_EXCL: 1,
|
|
51
|
-
COPYFILE_FICLONE: 2,
|
|
52
|
-
COPYFILE_FICLONE_FORCE: 4,
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=constants.js.map
|
package/lib/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,GAAG,GAAG,GAAG,CAAC;AAMV,QAAA,SAAS,GAAG;IACvB,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC;IACX,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,GAAG;IACX,QAAQ,EAAE,GAAG;IACb,OAAO,EAAE,GAAG;IACZ,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,MAAM;IAClB,MAAM,EAAE,OAAO;IACf,SAAS,EAAE,OAAO;IAClB,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IAEV,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IAEP,iBAAiB,EAAE,CAAC;IACpB,sBAAsB,EAAE,CAAC;IAEzB,mBAAmB,EAAE,CAAC;IACtB,sBAAsB,EAAE,CAAC;IACzB,4BAA4B,EAAE,CAAC;IAC/B,aAAa,EAAE,CAAC;IAChB,gBAAgB,EAAE,CAAC;IACnB,sBAAsB,EAAE,CAAC;CAC1B,CAAC"}
|
package/lib/consts/AMODE.d.ts
DELETED
package/lib/consts/AMODE.js
DELETED
package/lib/consts/AMODE.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AMODE.js","sourceRoot":"","sources":["../../src/consts/AMODE.ts"],"names":[],"mappings":""}
|
package/lib/consts/FLAG.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Constants used in `open` system calls, see [open(2)](http://man7.org/linux/man-pages/man2/open.2.html).
|
|
3
|
-
*
|
|
4
|
-
* These constants are compatible with Node.js fs constants and can be used with both
|
|
5
|
-
* memfs and native Node.js fs.promises.open().
|
|
6
|
-
*
|
|
7
|
-
* @see http://man7.org/linux/man-pages/man2/open.2.html
|
|
8
|
-
* @see https://www.gnu.org/software/libc/manual/html_node/Open_002dtime-Flags.html
|
|
9
|
-
*/
|
|
10
|
-
export declare enum FLAG {
|
|
11
|
-
O_RDONLY = 0,
|
|
12
|
-
O_WRONLY = 1,
|
|
13
|
-
O_RDWR = 2,
|
|
14
|
-
O_ACCMODE = 3,
|
|
15
|
-
O_CREAT = 64,
|
|
16
|
-
O_EXCL = 128,
|
|
17
|
-
O_NOCTTY = 256,
|
|
18
|
-
O_TRUNC = 512,
|
|
19
|
-
O_APPEND = 1024,
|
|
20
|
-
O_NONBLOCK = 2048,
|
|
21
|
-
O_DSYNC = 4096,
|
|
22
|
-
FASYNC = 8192,
|
|
23
|
-
O_DIRECT = 16384,
|
|
24
|
-
O_LARGEFILE = 0,
|
|
25
|
-
O_DIRECTORY = 65536,
|
|
26
|
-
O_NOFOLLOW = 131072,
|
|
27
|
-
O_NOATIME = 262144,
|
|
28
|
-
O_CLOEXEC = 524288,
|
|
29
|
-
O_SYNC = 1052672,
|
|
30
|
-
O_NDELAY = 2048
|
|
31
|
-
}
|
|
32
|
-
export declare const enum FLAG_CON {
|
|
33
|
-
O_RDONLY = 0,
|
|
34
|
-
O_WRONLY = 1,
|
|
35
|
-
O_RDWR = 2,
|
|
36
|
-
O_ACCMODE = 3,
|
|
37
|
-
O_CREAT = 64,
|
|
38
|
-
O_EXCL = 128,
|
|
39
|
-
O_NOCTTY = 256,
|
|
40
|
-
O_TRUNC = 512,
|
|
41
|
-
O_APPEND = 1024,
|
|
42
|
-
O_NONBLOCK = 2048,
|
|
43
|
-
O_DSYNC = 4096,
|
|
44
|
-
FASYNC = 8192,
|
|
45
|
-
O_DIRECT = 16384,
|
|
46
|
-
O_LARGEFILE = 0,
|
|
47
|
-
O_DIRECTORY = 65536,
|
|
48
|
-
O_NOFOLLOW = 131072,
|
|
49
|
-
O_NOATIME = 262144,
|
|
50
|
-
O_CLOEXEC = 524288,
|
|
51
|
-
O_SYNC = 1052672,
|
|
52
|
-
O_NDELAY = 2048
|
|
53
|
-
}
|
package/lib/consts/FLAG.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FLAG = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Constants used in `open` system calls, see [open(2)](http://man7.org/linux/man-pages/man2/open.2.html).
|
|
6
|
-
*
|
|
7
|
-
* These constants are compatible with Node.js fs constants and can be used with both
|
|
8
|
-
* memfs and native Node.js fs.promises.open().
|
|
9
|
-
*
|
|
10
|
-
* @see http://man7.org/linux/man-pages/man2/open.2.html
|
|
11
|
-
* @see https://www.gnu.org/software/libc/manual/html_node/Open_002dtime-Flags.html
|
|
12
|
-
*/
|
|
13
|
-
var FLAG;
|
|
14
|
-
(function (FLAG) {
|
|
15
|
-
FLAG[FLAG["O_RDONLY"] = 0] = "O_RDONLY";
|
|
16
|
-
FLAG[FLAG["O_WRONLY"] = 1] = "O_WRONLY";
|
|
17
|
-
FLAG[FLAG["O_RDWR"] = 2] = "O_RDWR";
|
|
18
|
-
FLAG[FLAG["O_ACCMODE"] = 3] = "O_ACCMODE";
|
|
19
|
-
FLAG[FLAG["O_CREAT"] = 64] = "O_CREAT";
|
|
20
|
-
FLAG[FLAG["O_EXCL"] = 128] = "O_EXCL";
|
|
21
|
-
FLAG[FLAG["O_NOCTTY"] = 256] = "O_NOCTTY";
|
|
22
|
-
FLAG[FLAG["O_TRUNC"] = 512] = "O_TRUNC";
|
|
23
|
-
FLAG[FLAG["O_APPEND"] = 1024] = "O_APPEND";
|
|
24
|
-
FLAG[FLAG["O_NONBLOCK"] = 2048] = "O_NONBLOCK";
|
|
25
|
-
FLAG[FLAG["O_DSYNC"] = 4096] = "O_DSYNC";
|
|
26
|
-
FLAG[FLAG["FASYNC"] = 8192] = "FASYNC";
|
|
27
|
-
FLAG[FLAG["O_DIRECT"] = 16384] = "O_DIRECT";
|
|
28
|
-
FLAG[FLAG["O_LARGEFILE"] = 0] = "O_LARGEFILE";
|
|
29
|
-
FLAG[FLAG["O_DIRECTORY"] = 65536] = "O_DIRECTORY";
|
|
30
|
-
FLAG[FLAG["O_NOFOLLOW"] = 131072] = "O_NOFOLLOW";
|
|
31
|
-
FLAG[FLAG["O_NOATIME"] = 262144] = "O_NOATIME";
|
|
32
|
-
FLAG[FLAG["O_CLOEXEC"] = 524288] = "O_CLOEXEC";
|
|
33
|
-
FLAG[FLAG["O_SYNC"] = 1052672] = "O_SYNC";
|
|
34
|
-
FLAG[FLAG["O_NDELAY"] = 2048] = "O_NDELAY";
|
|
35
|
-
})(FLAG || (exports.FLAG = FLAG = {}));
|
|
36
|
-
//# sourceMappingURL=FLAG.js.map
|
package/lib/consts/FLAG.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FLAG.js","sourceRoot":"","sources":["../../src/consts/FLAG.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACH,IAAY,IAqBX;AArBD,WAAY,IAAI;IACd,uCAAY,CAAA;IACZ,uCAAY,CAAA;IACZ,mCAAU,CAAA;IACV,yCAAa,CAAA;IACb,sCAAY,CAAA;IACZ,qCAAY,CAAA;IACZ,yCAAc,CAAA;IACd,uCAAa,CAAA;IACb,0CAAe,CAAA;IACf,8CAAiB,CAAA;IACjB,wCAAc,CAAA;IACd,sCAAa,CAAA;IACb,2CAAgB,CAAA;IAChB,6CAAe,CAAA;IACf,iDAAmB,CAAA;IACnB,gDAAmB,CAAA;IACnB,8CAAkB,CAAA;IAClB,8CAAkB,CAAA;IAClB,yCAAgB,CAAA;IAChB,0CAAe,CAAA;AACjB,CAAC,EArBW,IAAI,oBAAJ,IAAI,QAqBf"}
|
package/lib/core/File.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Buffer } from '../vendor/node/internal/buffer';
|
|
2
|
-
import type { Link } from './Link';
|
|
3
|
-
import type { Node } from './Node';
|
|
4
|
-
/**
|
|
5
|
-
* Represents an open file (file descriptor) that points to a `Link` (Hard-link) and a `Node`.
|
|
6
|
-
*
|
|
7
|
-
* @todo Rename to `OpenFile`.
|
|
8
|
-
*/
|
|
9
|
-
export declare class File {
|
|
10
|
-
readonly link: Link;
|
|
11
|
-
readonly node: Node;
|
|
12
|
-
flags: number;
|
|
13
|
-
fd: number;
|
|
14
|
-
/**
|
|
15
|
-
* A cursor/offset position in a file, where data will be written on write.
|
|
16
|
-
* User can "seek" this position.
|
|
17
|
-
*/
|
|
18
|
-
position: number;
|
|
19
|
-
/**
|
|
20
|
-
* Open a Link-Node pair. `node` is provided separately as that might be a different node
|
|
21
|
-
* rather the one `link` points to, because it might be a symlink.
|
|
22
|
-
* @param link
|
|
23
|
-
* @param node
|
|
24
|
-
* @param flags
|
|
25
|
-
* @param fd
|
|
26
|
-
*/
|
|
27
|
-
constructor(link: Link, node: Node, flags: number, fd: number);
|
|
28
|
-
getString(encoding?: string): string;
|
|
29
|
-
setString(str: string): void;
|
|
30
|
-
getBuffer(): Buffer;
|
|
31
|
-
setBuffer(buf: Buffer): void;
|
|
32
|
-
getSize(): number;
|
|
33
|
-
truncate(len?: number): void;
|
|
34
|
-
seekTo(position: number): void;
|
|
35
|
-
write(buf: Buffer, offset?: number, length?: number, position?: number | null): number;
|
|
36
|
-
read(buf: Buffer | ArrayBufferView | DataView, offset?: number, length?: number, position?: number): number;
|
|
37
|
-
chmod(perm: number): void;
|
|
38
|
-
chown(uid: number, gid: number): void;
|
|
39
|
-
}
|