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 CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- deno vendor "npm:single-file-core@1.5.16"
3
+ deno vendor "npm:single-file-core@1.5.20"
4
4
 
5
5
  echo "
6
6
  import { build } from 'npm:esbuild';
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@single-file/single-file-cli",
3
- "version": "2.0.54",
3
+ "version": "2.0.56",
4
4
  "description": "SingleFile CLI",
5
5
  "nodeModulesDir": true,
6
6
  "exports": {
@@ -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);