hfs 0.46.0 → 0.46.1-alpha1
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 +2 -0
- package/package.json +2 -2
- package/src/const.js +1 -1
- package/src/frontEndApis.js +1 -1
- package/src/util-files.js +3 -3
package/README.md
CHANGED
|
@@ -69,6 +69,8 @@ If your system is not Windows/Linux/Mac or you just don't want to run the binari
|
|
|
69
69
|
|
|
70
70
|
The `@latest` part is optional, and ensures that you are always up to date.
|
|
71
71
|
|
|
72
|
+
If this procedure fails, it may be that you are missing one of [these requirements](https://github.com/nodejs/node-gyp#installation).
|
|
73
|
+
|
|
72
74
|
Configuration and other files will be stored in `%HOME%/.vfs`
|
|
73
75
|
|
|
74
76
|
### Service
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hfs",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.1-alpha1",
|
|
4
4
|
"description": "HTTP File Server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"file server",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"fast-glob": "^3.2.7",
|
|
69
69
|
"find-process": "^1.4.7",
|
|
70
70
|
"formidable": "^2.1.1",
|
|
71
|
-
"fs-
|
|
71
|
+
"fs-x-attributes": "^1.0.0",
|
|
72
72
|
"koa": "^2.13.4",
|
|
73
73
|
"koa-compress": "^5.1.0",
|
|
74
74
|
"koa-mount": "^4.0.0",
|
package/src/const.js
CHANGED
|
@@ -38,7 +38,7 @@ exports.DEV = process.env.DEV || exports.argv.dev ? 'DEV' : '';
|
|
|
38
38
|
exports.ORIGINAL_CWD = process.cwd();
|
|
39
39
|
exports.HFS_STARTED = new Date();
|
|
40
40
|
const PKG_PATH = (0, path_1.join)(__dirname, '..', 'package.json');
|
|
41
|
-
exports.BUILD_TIMESTAMP = "2023-07-
|
|
41
|
+
exports.BUILD_TIMESTAMP = "2023-07-06T18:13:41.831Z";
|
|
42
42
|
const pkg = JSON.parse(fs.readFileSync(PKG_PATH, 'utf8'));
|
|
43
43
|
exports.VERSION = pkg.version;
|
|
44
44
|
exports.DAY = 86400000;
|
package/src/frontEndApis.js
CHANGED
package/src/util-files.js
CHANGED
|
@@ -17,7 +17,7 @@ const stream_1 = require("stream");
|
|
|
17
17
|
// @ts-ignore
|
|
18
18
|
const unzip_stream_1 = __importDefault(require("unzip-stream"));
|
|
19
19
|
// @ts-ignore
|
|
20
|
-
const
|
|
20
|
+
const fs_x_attributes_1 = __importDefault(require("fs-x-attributes"));
|
|
21
21
|
async function isDirectory(path) {
|
|
22
22
|
try {
|
|
23
23
|
return (await promises_1.default.stat(path)).isDirectory();
|
|
@@ -168,7 +168,7 @@ function isValidFileName(name) {
|
|
|
168
168
|
exports.isValidFileName = isValidFileName;
|
|
169
169
|
const FILE_ATTR_PREFIX = 'user.hfs.'; // user. prefix to be linux compatible
|
|
170
170
|
function storeFileAttr(path, k, v) {
|
|
171
|
-
return (0, util_1.promisify)(
|
|
171
|
+
return (0, util_1.promisify)(fs_x_attributes_1.default.set)(path, FILE_ATTR_PREFIX + k, JSON.stringify(v))
|
|
172
172
|
.then(() => true, (e) => {
|
|
173
173
|
console.error("couldn't store metadata on", path, String(e.message || e));
|
|
174
174
|
return false;
|
|
@@ -177,6 +177,6 @@ function storeFileAttr(path, k, v) {
|
|
|
177
177
|
exports.storeFileAttr = storeFileAttr;
|
|
178
178
|
async function loadFileAttr(path, k) {
|
|
179
179
|
var _a;
|
|
180
|
-
return (_a = (0, misc_1.tryJson)(String(await (0, util_1.promisify)(
|
|
180
|
+
return (_a = (0, misc_1.tryJson)(String(await (0, util_1.promisify)(fs_x_attributes_1.default.get)(path, FILE_ATTR_PREFIX + k)))) !== null && _a !== void 0 ? _a : undefined; // normalize, as we get null instead of undefined on windows
|
|
181
181
|
}
|
|
182
182
|
exports.loadFileAttr = loadFileAttr;
|