Call node-based checks from a node script rather than Python
@GantaRoja is already working on this.
Since Aug 12, 2025.
- Dominant language
- Jupyter Notebook
- Stars
- 106
- Forks
- 223
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 72
Description
There's quite a large overhead to starting up a node script. For example, npm run check:orphan-pages takes ~1.4s on my machine, but console.time shows we only spend ~30ms in the main function. Some of that will be transpiling time, which we can't improve, but some it is avoidable overhead of running many scripts.
We could trim quite a few seconds off ./check simply by having a single node script that calls many checks' main functions, rather than having many separate node scripts.
That is, rather than
npm run check:markdown
npm run check:spelling
npm run check:orphan-pages
# etc.
We'd just have one command (name TBD) that has a single script that calls the main functions of each of these scripts:
zxMain(async () => {
await checkSpelling();
await checkMarkdown();
await checkOrphanPages()
// etc.
});
This should be a relatively simple fix:
- First, remove
process.exitfrom the scripts and have them export theirmainfunction rather than executing it. You could maybe have eachmainfunction return it's exit code instead. - For the checks that accept it, pass through the
apisargument as an input to their function - Update
./checkand.github/workflowsto use this new meta-script
Once that's working, consider using Promise.all to run the checks asynchronously.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.