Skip to content

Commit c57d8ef

Browse files
authored
chore: remove fs-extra (#124)
* chore: remove fs-extra The fs module has promises support so just use that instead.
1 parent c4071d9 commit c57d8ef

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"./src/files/glob-source": false,
1919
"./test/files/glob-source.spec.js": false,
2020
"electron-fetch": false,
21-
"fs-extra": false,
22-
"graceful-fs": false
21+
"fs": false
2322
},
2423
"types": "dist/src/index.d.ts",
2524
"typesVersions": {
@@ -50,7 +49,6 @@
5049
"buffer": "^6.0.1",
5150
"electron-fetch": "^1.7.2",
5251
"err-code": "^3.0.1",
53-
"fs-extra": "^9.0.1",
5452
"is-electron": "^2.2.0",
5553
"iso-url": "^1.0.0",
5654
"it-glob": "~0.0.11",
@@ -63,8 +61,6 @@
6361
"stream-to-it": "^0.2.2"
6462
},
6563
"devDependencies": {
66-
"@types/err-code": "^2.0.0",
67-
"@types/fs-extra": "^9.0.5",
6864
"aegir": "^33.1.0",
6965
"delay": "^5.0.0",
7066
"events": "^3.3.0",

src/files/glob-source.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict'
22

3-
const fs = require('fs-extra')
3+
const fsp = require('fs').promises
4+
const fs = require('fs')
45
const glob = require('it-glob')
56
const Path = require('path')
67
const errCode = require('err-code')
@@ -47,7 +48,7 @@ module.exports = async function * globSource (paths, options) {
4748
}
4849

4950
const absolutePath = Path.resolve(process.cwd(), path)
50-
const stat = await fs.stat(absolutePath)
51+
const stat = await fsp.stat(absolutePath)
5152
const prefix = Path.dirname(absolutePath)
5253

5354
let mode = options.mode
@@ -117,7 +118,7 @@ async function * toGlobSource ({ path, type, prefix, mode, mtime, preserveMode,
117118
})
118119

119120
for await (const p of glob(path, '**/*', globOptions)) {
120-
const stat = await fs.stat(p)
121+
const stat = await fsp.stat(p)
121122

122123
if (preserveMode || preserveMtime) {
123124
if (preserveMode) {

test/files/glob-source.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const path = require('path')
88
const {
99
isNode
1010
} = require('../../src/env')
11-
const fs = require('fs-extra')
11+
const fs = require('fs')
1212

1313
/**
1414
* @param {string} file

0 commit comments

Comments
 (0)