mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 16:17:25 +02:00
refactor: prefer fs.readJSON over readFile.then(JSON.parse) (#7186)
* refactor: prefer fs.readJSON over readFile.then(JSON.parse) * refactor: use promises
This commit is contained in:
parent
674a77f02d
commit
200009008b
9 changed files with 27 additions and 33 deletions
|
@ -37,8 +37,8 @@ async function generateTemplateExample(template) {
|
|||
);
|
||||
|
||||
// read the content of the package.json
|
||||
const templatePackageJson = JSON.parse(
|
||||
await fs.readFile(`examples/${template}/package.json`, 'utf8'),
|
||||
const templatePackageJson = await fs.readJSON(
|
||||
`examples/${template}/package.json`,
|
||||
);
|
||||
|
||||
// attach the dev script which would be used in code sandbox by default
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue