@vuebro/fsa 1.0.1 → 1.0.3

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 CHANGED
@@ -40,14 +40,7 @@ Note: Support in other browsers may vary. Check [caniuse.com](https://caniuse.co
40
40
 
41
41
  The library provides the following functions:
42
42
 
43
- ### `getHandle(Bucket, Key, create?)`
44
43
 
45
- Gets a file or directory handle from the file system
46
-
47
- - `Bucket` - The root directory handle (`FileSystemDirectoryHandle`)
48
- - `Key` - The path to the file or directory (string)
49
- - `create` - Whether to create the directory if it doesn't exist (boolean, optional, default: false)
50
- - Returns: Promise resolving to `FileSystemDirectoryHandle | FileSystemFileHandle | undefined`
51
44
 
52
45
  ### `deleteObject(Bucket, Key)`
53
46
 
@@ -104,7 +97,6 @@ First, you'll need to get a directory handle from the user using the File System
104
97
 
105
98
  ```javascript
106
99
  import {
107
- getHandle,
108
100
  putObject,
109
101
  getObjectText,
110
102
  deleteObject,
@@ -138,8 +130,7 @@ try {
138
130
  // Example: Delete a file
139
131
  await deleteObject(directoryHandle, 'path/to/file.txt');
140
132
 
141
- // Example: Get file/directory handle
142
- const handle = await getHandle(directoryHandle, 'path/to/directory');
133
+
143
134
 
144
135
  // Example: Remove empty directories (excluding specific ones)
145
136
  await removeEmptyDirectories(directoryHandle, ['.git', 'node_modules']);
package/dist/index.d.ts CHANGED
@@ -1,4 +1,2 @@
1
1
  import type { StreamingBlobPayloadInputTypes } from "@smithy/types";
2
- declare const getHandle: (Bucket: FileSystemDirectoryHandle, Key: string, create?: boolean) => Promise<FileSystemDirectoryHandle | FileSystemFileHandle | undefined>;
3
- declare const deleteObject: (Bucket: FileSystemDirectoryHandle, Key: string) => Promise<void>, getObjectBlob: (Bucket: FileSystemDirectoryHandle, Key: string) => Promise<Blob>, getObjectText: (Bucket: FileSystemDirectoryHandle, Key: string) => Promise<string>, headObject: (Bucket: FileSystemDirectoryHandle, Key: string) => Promise<undefined>, putObject: (Bucket: FileSystemDirectoryHandle, Key: string, body: StreamingBlobPayloadInputTypes) => Promise<void>, removeEmptyDirectories: (directory: FileSystemDirectoryHandle, exclude: string[]) => Promise<void>;
4
- export { deleteObject, getHandle, getObjectBlob, getObjectText, headObject, putObject, removeEmptyDirectories, };
2
+ export declare const deleteObject: (Bucket: FileSystemDirectoryHandle, Key: string) => Promise<void>, getObjectBlob: (Bucket: FileSystemDirectoryHandle, Key: string) => Promise<Blob>, getObjectText: (Bucket: FileSystemDirectoryHandle, Key: string) => Promise<string>, headObject: (Bucket: FileSystemDirectoryHandle, Key: string) => Promise<undefined>, putObject: (Bucket: FileSystemDirectoryHandle, Key: string, body: StreamingBlobPayloadInputTypes) => Promise<void>, removeEmptyDirectories: (directory: FileSystemDirectoryHandle, exclude: string[]) => Promise<void>;
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ const getHandle = (Bucket, Key, create = false) => Key.split("/").reduce(async (
17
17
  }
18
18
  return;
19
19
  }, Promise.resolve(Bucket));
20
- const deleteObject = async (Bucket, Key) => {
20
+ export const deleteObject = async (Bucket, Key) => {
21
21
  const keys = Key.split("/"), name = keys.pop();
22
22
  if (name) {
23
23
  const handle = await getHandle(Bucket, keys.join("/"));
@@ -54,4 +54,3 @@ const deleteObject = async (Bucket, Key) => {
54
54
  await Promise.allSettled(values.map(({ name }) => directory.removeEntry(name)));
55
55
  }
56
56
  };
57
- export { deleteObject, getHandle, getObjectBlob, getObjectText, headObject, putObject, removeEmptyDirectories, };
package/package.json CHANGED
@@ -1,9 +1,23 @@
1
1
  {
2
2
  "name": "@vuebro/fsa",
3
- "version": "1.0.1",
4
- "description": "File System Access API wrapper",
3
+ "version": "1.0.3",
4
+ "description": "A TypeScript library providing a File System Access API wrapper that enables web applications to interact with the user's local file system using AWS S3-like operations (get, put, delete, head). Designed for modern browsers, this library offers structured file and directory access capabilities similar to cloud storage APIs, allowing web applications to work with local files and directories more efficiently than traditional file input methods.",
5
5
  "keywords": [
6
- "File System Access API"
6
+ "file-system-access",
7
+ "web-api",
8
+ "file-handling",
9
+ "fsa-api",
10
+ "browser-filesystem",
11
+ "file-operations",
12
+ "s3-like-api",
13
+ "typescript",
14
+ "web-storage",
15
+ "local-file-system",
16
+ "file-upload",
17
+ "file-download",
18
+ "directory-handle",
19
+ "file-handle",
20
+ "web-platform"
7
21
  ],
8
22
  "homepage": "https://github.com/vuebro/fsa#readme",
9
23
  "bugs": {
@@ -14,10 +28,7 @@
14
28
  "url": "git+https://github.com/vuebro/fsa.git"
15
29
  },
16
30
  "license": "AGPL-3.0-only",
17
- "author": {
18
- "name": "Jerry Bruwes",
19
- "email": "jbruwes@gmail.com"
20
- },
31
+ "author": "Jerry Bruwes <jbruwes@gmail.com> (https://jbruwes.github.io)",
21
32
  "type": "module",
22
33
  "main": "dist/index.js",
23
34
  "files": [
@@ -31,7 +42,7 @@
31
42
  "devDependencies": {
32
43
  "@smithy/types": "^4.8.1",
33
44
  "@types/node": "24.10.0",
34
- "@vuebro/configs": "^1.1.63",
45
+ "@vuebro/configs": "^1.1.75",
35
46
  "eslint": "^9.39.1"
36
47
  }
37
48
  }