Skip to content

Commit

Permalink
cjs => mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle committed Oct 29, 2024
1 parent 2dcf0db commit 8032a65
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion test/ecmascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ In our case, we only need to test parsing and not actually execute the tests.
You can run the following script from this directory to update this test suite.

```sh
node update-all-data.js
node update-all-data.mjs
```
14 changes: 0 additions & 14 deletions test/ecmascript/update-all-data.js

This file was deleted.

15 changes: 15 additions & 0 deletions test/ecmascript/update-all-data.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { readdir, writeFile } from 'fs/promises';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const files = await readdir(__dirname);
for (const file of files.filter(f => f.startsWith('data-'))) {
const url = `https://raw.githubusercontent.com/kangax/compat-table/gh-pages/${file}`;
const res = await fetch(url);
const text = await res.text();
await writeFile(join(__dirname, file), text);
}
console.log('Update complete!')

0 comments on commit 8032a65

Please sign in to comment.