We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5aec39c + 9ebe258 commit 9d48ab6Copy full SHA for 9d48ab6
stdlib/quickjs/file.rb
@@ -0,0 +1,11 @@
1
+class File
2
+ def self.read(path)
3
+ %x{
4
+ const body = std.loadFile(path);
5
+ if (body === null) {
6
+ throw new Error(`Unable to read "${path}"`);
7
+ }
8
+ return body;
9
10
+ end
11
+end
0 commit comments