Skip to content

Commit e666309

Browse files
authored
feat: remove owner related code as well as stale polyfills (#53)
BREAKING CHANGE: this removes the `owner` option from all methods that previously supported it, as well as the `withOwner` and `withOwnerSync` methods
1 parent 7ec9b2d commit e666309

25 files changed

+7
-1927
lines changed

README.md

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,8 @@ polyfills, and extensions, of the core `fs` module.
55
## Features
66

77
- all exposed functions return promises
8-
- `fs.rm` polyfill for node versions < 14.14.0
9-
- `fs.mkdir` polyfill adding support for the `recursive` and `force` options in node versions < 10.12.0
10-
- `fs.copyFile` extended to accept an `owner` option
11-
- `fs.mkdir` extended to accept an `owner` option
12-
- `fs.mkdtemp` extended to accept an `owner` option
13-
- `fs.writeFile` extended to accept an `owner` option
14-
- `fs.withTempDir` added
15-
- `fs.withOwner` added
16-
- `fs.withOwnerSync` added
178
- `fs.cp` polyfill for node < 16.7.0
18-
19-
## The `owner` option
20-
21-
The `copyFile`, `mkdir`, `mkdtemp`, `writeFile`, and `withTempDir` functions
22-
all accept a new `owner` property in their options. It can be used in two ways:
23-
24-
- `{ owner: { uid: 100, gid: 100 } }` - set the `uid` and `gid` explicitly
25-
- `{ owner: 100 }` - use one value, will set both `uid` and `gid` the same
26-
27-
The special string `'inherit'` may be passed instead of a number, which will
28-
cause this module to automatically determine the correct `uid` and/or `gid`
29-
from the nearest existing parent directory of the target.
9+
- `fs.withTempDir` added
3010

3111
## `fs.withTempDir(root, fn, options) -> Promise`
3212

lib/common/owner-sync.js

Lines changed: 0 additions & 96 deletions
This file was deleted.

lib/common/owner.js

Lines changed: 0 additions & 96 deletions
This file was deleted.

lib/copy-file.js

Lines changed: 0 additions & 16 deletions
This file was deleted.
File renamed without changes.

lib/cp/polyfill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const {
2323
ERR_FS_CP_UNKNOWN,
2424
ERR_FS_EISDIR,
2525
ERR_INVALID_ARG_TYPE,
26-
} = require('../errors.js')
26+
} = require('./errors.js')
2727
const {
2828
constants: {
2929
errno: {

lib/index.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
module.exports = {
22
...require('./fs.js'),
3-
copyFile: require('./copy-file.js'),
43
cp: require('./cp/index.js'),
5-
mkdir: require('./mkdir.js'),
6-
mkdtemp: require('./mkdtemp.js'),
7-
rm: require('./rm/index.js'),
84
withTempDir: require('./with-temp-dir.js'),
9-
withOwner: require('./with-owner.js'),
10-
withOwnerSync: require('./with-owner-sync.js'),
11-
writeFile: require('./write-file.js'),
125
}

lib/mkdir.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

lib/mkdtemp.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

lib/rm/index.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)