sable 0.5.18 → 0.5.19
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 +12 -8
- package/cjs/cli.cjs +18 -2
- package/esm/cli.mjs +18 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -30,14 +30,18 @@ Usage: sable [options] [documentRoot...]
|
|
|
30
30
|
Starts an HTTP development server
|
|
31
31
|
|
|
32
32
|
Options:
|
|
33
|
-
-V, --version
|
|
34
|
-
-p, --port <n>
|
|
35
|
-
-h, --host <s>
|
|
36
|
-
-v, --verbose
|
|
37
|
-
--noWatch
|
|
38
|
-
-i, --index <s>
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
-V, --version Output the version number
|
|
34
|
+
-p, --port <n> Port number for HTTP/HTTPS (default: 4000)
|
|
35
|
+
-h, --host <s> Host name to bind
|
|
36
|
+
-v, --verbose Enable verbose logging
|
|
37
|
+
--noWatch Set the watch option to false
|
|
38
|
+
-i, --index <s> Value for the index option (default: index.html)
|
|
39
|
+
-F, --fileOperations Enable all file operations (upload, delete, text upload)
|
|
40
|
+
--allowFileUpload Enable file upload
|
|
41
|
+
--allowDelete Enable file deletion
|
|
42
|
+
--allowTextUpload Enable text upload
|
|
43
|
+
[documentRoot...] Directories that contain files to be served
|
|
44
|
+
-h, --help Output usage information
|
|
41
45
|
```
|
|
42
46
|
|
|
43
47
|
## Javascript API
|
package/cjs/cli.cjs
CHANGED
|
@@ -78,14 +78,21 @@ var program = new import_commander.Command().version(version).description("Start
|
|
|
78
78
|
"-p, --port <n>",
|
|
79
79
|
"Port number for HTTP/HTTPS (default: 4000)",
|
|
80
80
|
Number.parseInt
|
|
81
|
-
).option("-h, --host <s>", "Host name to bind").option("-v, --verbose", "Enable verbose logging").option("--noWatch", "Set the watch option to false").option("-i, --index <s>", "Value for the index option (default: index.html)").
|
|
81
|
+
).option("-h, --host <s>", "Host name to bind").option("-v, --verbose", "Enable verbose logging").option("--noWatch", "Set the watch option to false").option("-i, --index <s>", "Value for the index option (default: index.html)").option(
|
|
82
|
+
"-F, --fileOperations",
|
|
83
|
+
"Enable all file operations (upload, delete, text upload)"
|
|
84
|
+
).option("--allowFileUpload", "Enable file upload").option("--allowDelete", "Enable file deletion").option("--allowTextUpload", "Enable text upload").argument("[documentRoot...]", "Directories that contain files to be served");
|
|
82
85
|
program.parse();
|
|
83
86
|
var {
|
|
84
87
|
noWatch,
|
|
85
88
|
port,
|
|
86
89
|
host,
|
|
87
90
|
verbose = false,
|
|
88
|
-
index
|
|
91
|
+
index,
|
|
92
|
+
fileOperations,
|
|
93
|
+
allowFileUpload,
|
|
94
|
+
allowDelete,
|
|
95
|
+
allowTextUpload
|
|
89
96
|
} = program.opts();
|
|
90
97
|
var documentRoot = program.args;
|
|
91
98
|
if (documentRoot.length === 0) {
|
|
@@ -111,6 +118,15 @@ if (Array.isArray(index)) {
|
|
|
111
118
|
} else if (index) {
|
|
112
119
|
options.index = index;
|
|
113
120
|
}
|
|
121
|
+
if (fileOperations) {
|
|
122
|
+
options.fileOperations = true;
|
|
123
|
+
} else if (allowFileUpload || allowDelete || allowTextUpload) {
|
|
124
|
+
options.fileOperations = {
|
|
125
|
+
allowFileUpload,
|
|
126
|
+
allowDelete,
|
|
127
|
+
allowTextUpload
|
|
128
|
+
};
|
|
129
|
+
}
|
|
114
130
|
startServer(options).catch((error) => {
|
|
115
131
|
console.error(error);
|
|
116
132
|
process.exit(1);
|
package/esm/cli.mjs
CHANGED
|
@@ -54,14 +54,21 @@ var program = new Command().version(version).description("Starts an HTTP develop
|
|
|
54
54
|
"-p, --port <n>",
|
|
55
55
|
"Port number for HTTP/HTTPS (default: 4000)",
|
|
56
56
|
Number.parseInt
|
|
57
|
-
).option("-h, --host <s>", "Host name to bind").option("-v, --verbose", "Enable verbose logging").option("--noWatch", "Set the watch option to false").option("-i, --index <s>", "Value for the index option (default: index.html)").
|
|
57
|
+
).option("-h, --host <s>", "Host name to bind").option("-v, --verbose", "Enable verbose logging").option("--noWatch", "Set the watch option to false").option("-i, --index <s>", "Value for the index option (default: index.html)").option(
|
|
58
|
+
"-F, --fileOperations",
|
|
59
|
+
"Enable all file operations (upload, delete, text upload)"
|
|
60
|
+
).option("--allowFileUpload", "Enable file upload").option("--allowDelete", "Enable file deletion").option("--allowTextUpload", "Enable text upload").argument("[documentRoot...]", "Directories that contain files to be served");
|
|
58
61
|
program.parse();
|
|
59
62
|
var {
|
|
60
63
|
noWatch,
|
|
61
64
|
port,
|
|
62
65
|
host,
|
|
63
66
|
verbose = false,
|
|
64
|
-
index
|
|
67
|
+
index,
|
|
68
|
+
fileOperations,
|
|
69
|
+
allowFileUpload,
|
|
70
|
+
allowDelete,
|
|
71
|
+
allowTextUpload
|
|
65
72
|
} = program.opts();
|
|
66
73
|
var documentRoot = program.args;
|
|
67
74
|
if (documentRoot.length === 0) {
|
|
@@ -87,6 +94,15 @@ if (Array.isArray(index)) {
|
|
|
87
94
|
} else if (index) {
|
|
88
95
|
options.index = index;
|
|
89
96
|
}
|
|
97
|
+
if (fileOperations) {
|
|
98
|
+
options.fileOperations = true;
|
|
99
|
+
} else if (allowFileUpload || allowDelete || allowTextUpload) {
|
|
100
|
+
options.fileOperations = {
|
|
101
|
+
allowFileUpload,
|
|
102
|
+
allowDelete,
|
|
103
|
+
allowTextUpload
|
|
104
|
+
};
|
|
105
|
+
}
|
|
90
106
|
startServer(options).catch((error) => {
|
|
91
107
|
console.error(error);
|
|
92
108
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sable",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.19",
|
|
4
4
|
"description": "HTTP development server with file watching",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Kei Ito",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"version:add": "git add ."
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"commander": "14.0.
|
|
44
|
+
"commander": "14.0.3",
|
|
45
45
|
"connect": "3.7.0",
|
|
46
|
-
"middleware-static-livereload": "1.5.
|
|
46
|
+
"middleware-static-livereload": "1.5.3"
|
|
47
47
|
}
|
|
48
48
|
}
|