We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent edea223 commit f39257bCopy full SHA for f39257b
src/fetcher.ts
@@ -1,4 +1,5 @@
1
import * as fs from "fs";
2
+import * as path from "path";
3
import fetch from "node-fetch";
4
import { JSDOM } from "jsdom";
5
@@ -10,11 +11,10 @@ interface IDLSource {
10
11
}
12
13
async function fetchIDLs() {
- const file = fs.readFileSync(`${__dirname}/../inputfiles/idlSources.json`, { encoding: "utf-8" });
14
- const idlSources = JSON.parse(file) as IDLSource[];
+ const idlSources = require("../inputfiles/idlSources.json") as IDLSource[];
15
for (const source of idlSources) {
16
const idl = await fetchIDL(source);
17
- fs.writeFileSync(`${__dirname}/../inputfiles/idl/${source.title}.widl`, idl + '\n');
+ fs.writeFileSync(path.join(__dirname, `../inputfiles/idl/${source.title}.widl`), idl + '\n');
18
19
20
0 commit comments