@lvce-editor/file-system-process 5.16.1 → 5.17.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/dist/index.js +7 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1894,6 +1894,12 @@ const getFileHashes = async uris => {
|
|
|
1894
1894
|
await flush();
|
|
1895
1895
|
return hashes;
|
|
1896
1896
|
};
|
|
1897
|
+
const getFileSize = async uri => {
|
|
1898
|
+
assertUri(uri);
|
|
1899
|
+
const path = fileURLToPath(uri);
|
|
1900
|
+
const stats = await fs.stat(path);
|
|
1901
|
+
return stats.size;
|
|
1902
|
+
};
|
|
1897
1903
|
const writeFile = async (uri, content, encoding = Utf8) => {
|
|
1898
1904
|
try {
|
|
1899
1905
|
assertUri(uri);
|
|
@@ -2160,6 +2166,7 @@ const commandMap = {
|
|
|
2160
2166
|
'FileSystem.forceRemove': forceRemove,
|
|
2161
2167
|
'FileSystem.getFileHash': getFileHash,
|
|
2162
2168
|
'FileSystem.getFileHashes': getFileHashes,
|
|
2169
|
+
'FileSystem.getFileSize': getFileSize,
|
|
2163
2170
|
'FileSystem.getFolderSize': getFolderSize,
|
|
2164
2171
|
'FileSystem.isReadonly': isReadonly,
|
|
2165
2172
|
'FileSystem.mkdir': mkdir,
|