1
0
mirror of synced 2025-12-20 18:36:31 -05:00

Update some readFileSync to await readFile with top level await (#20525)

* Update some readFileSync to await readFile with top level await

* More updates

* Update all-products.js

* Use 'lib/readfile-async.js' in runtime files for better performance

* Remove unnecessary use of 'for await...of' loops

* Revert to importing 'fs/promises'

Co-authored-by: James M. Greene <jamesmgreene@github.com>
This commit is contained in:
Kevin Heis
2021-07-29 09:45:46 -07:00
committed by GitHub
parent 47f358b4c0
commit 0b1ff73a46
23 changed files with 112 additions and 99 deletions

View File

@@ -1,12 +1,12 @@
#!/usr/bin/env node
import fs from 'fs'
import fs from 'fs/promises'
import path from 'path'
import cheerio from 'cheerio'
import { liquid } from '../../../lib/render-content/index.js'
import getMiniTocItems from '../../../lib/get-mini-toc-items.js'
import rewriteLocalLinks from '../../../lib/rewrite-local-links.js'
const includes = path.join(process.cwd(), 'includes')
const inputObjectIncludeFile = fs.readFileSync(
const inputObjectIncludeFile = await fs.readFile(
path.join(includes, 'graphql-input-object.html'),
'utf8'
)