mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-23 23:29:17 -05:00
5
.changeset/friendly-pumas-prove.md
Normal file
5
.changeset/friendly-pumas-prove.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/read-project-manifest": patch
|
||||
---
|
||||
|
||||
Use graceful-fs in order to avoid EMFILE errors.
|
||||
@@ -33,6 +33,7 @@
|
||||
"@pnpm/write-project-manifest": "workspace:2.0.0",
|
||||
"detect-indent": "^6.0.0",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"graceful-fs": "^4.2.6",
|
||||
"is-windows": "^1.0.2",
|
||||
"json5": "^2.1.3",
|
||||
"parse-json": "^5.1.0",
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import { promises as fs } from 'fs'
|
||||
import { promisify } from 'util'
|
||||
import gracefulFs from 'graceful-fs'
|
||||
import { ProjectManifest } from '@pnpm/types'
|
||||
import JSON5 from 'json5'
|
||||
import parseJson from 'parse-json'
|
||||
import stripBom from 'strip-bom'
|
||||
|
||||
// We use graceful-fs to avoid EMFILE errors.
|
||||
const readFile = promisify(gracefulFs.readFile)
|
||||
|
||||
export async function readJson5File (filePath: string) {
|
||||
const text = await readFileWithoutBom(filePath)
|
||||
try {
|
||||
@@ -32,5 +36,5 @@ export async function readJsonFile (filePath: string) {
|
||||
}
|
||||
|
||||
async function readFileWithoutBom (path: string) {
|
||||
return stripBom(await fs.readFile(path, 'utf8'))
|
||||
return stripBom(await readFile(path, 'utf8'))
|
||||
}
|
||||
|
||||
2
pnpm-lock.yaml
generated
2
pnpm-lock.yaml
generated
@@ -2530,6 +2530,7 @@ importers:
|
||||
'@types/parse-json': ^4.0.0
|
||||
detect-indent: ^6.0.0
|
||||
fast-deep-equal: ^3.1.3
|
||||
graceful-fs: ^4.2.6
|
||||
is-windows: ^1.0.2
|
||||
json5: ^2.1.3
|
||||
parse-json: ^5.1.0
|
||||
@@ -2543,6 +2544,7 @@ importers:
|
||||
'@pnpm/write-project-manifest': link:../write-project-manifest
|
||||
detect-indent: 6.0.0
|
||||
fast-deep-equal: 3.1.3
|
||||
graceful-fs: 4.2.6
|
||||
is-windows: 1.0.2
|
||||
json5: 2.2.0
|
||||
parse-json: 5.2.0
|
||||
|
||||
Reference in New Issue
Block a user