single-file-cli 2.0.54 → 2.0.56
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/build.sh +1 -1
- package/deno.json +1 -1
- package/lib/deno-polyfill.js +10 -0
- package/lib/single-file-bundle.js +1 -1
- package/lib/version.js +1 -1
- package/options.js +1 -0
- package/package.json +1 -1
- package/single-file-launcher.js +4 -1
package/build.sh
CHANGED
package/deno.json
CHANGED
package/lib/deno-polyfill.js
CHANGED
|
@@ -100,6 +100,7 @@ const Command = DENO_RUNTIME_DETECTED ? Deno.Command : class Command {
|
|
|
100
100
|
|
|
101
101
|
const DenoAPI = {
|
|
102
102
|
args,
|
|
103
|
+
readFile,
|
|
103
104
|
readTextFile,
|
|
104
105
|
writeTextFile,
|
|
105
106
|
writeFile,
|
|
@@ -133,6 +134,15 @@ async function initGlobalThisProperties() {
|
|
|
133
134
|
}
|
|
134
135
|
}
|
|
135
136
|
|
|
137
|
+
async function readFile(path) {
|
|
138
|
+
if (DENO_RUNTIME_DETECTED) {
|
|
139
|
+
return Deno.readFile(path);
|
|
140
|
+
} else {
|
|
141
|
+
const fsPromise = await import(NODE_MODULES["fs"]);
|
|
142
|
+
return new Uint8Array(await fsPromise.readFile(path));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
136
146
|
async function readTextFile(path) {
|
|
137
147
|
if (DENO_RUNTIME_DETECTED) {
|
|
138
148
|
return Deno.readTextFile(path);
|