Skip to content

Commit

Permalink
feat: remove owner related code as well as stale polyfills (#53)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: this removes the `owner` option from all methods that previously supported it, as well as the `withOwner` and `withOwnerSync` methods
  • Loading branch information
nlf committed Oct 11, 2022
1 parent 7ec9b2d commit e666309
Show file tree
Hide file tree
Showing 25 changed files with 7 additions and 1,927 deletions.
22 changes: 1 addition & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,8 @@ polyfills, and extensions, of the core `fs` module.
## Features

- all exposed functions return promises
- `fs.rm` polyfill for node versions < 14.14.0
- `fs.mkdir` polyfill adding support for the `recursive` and `force` options in node versions < 10.12.0
- `fs.copyFile` extended to accept an `owner` option
- `fs.mkdir` extended to accept an `owner` option
- `fs.mkdtemp` extended to accept an `owner` option
- `fs.writeFile` extended to accept an `owner` option
- `fs.withTempDir` added
- `fs.withOwner` added
- `fs.withOwnerSync` added
- `fs.cp` polyfill for node < 16.7.0

## The `owner` option

The `copyFile`, `mkdir`, `mkdtemp`, `writeFile`, and `withTempDir` functions
all accept a new `owner` property in their options. It can be used in two ways:

- `{ owner: { uid: 100, gid: 100 } }` - set the `uid` and `gid` explicitly
- `{ owner: 100 }` - use one value, will set both `uid` and `gid` the same

The special string `'inherit'` may be passed instead of a number, which will
cause this module to automatically determine the correct `uid` and/or `gid`
from the nearest existing parent directory of the target.
- `fs.withTempDir` added

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

Expand Down
96 changes: 0 additions & 96 deletions lib/common/owner-sync.js

This file was deleted.

96 changes: 0 additions & 96 deletions lib/common/owner.js

This file was deleted.

16 changes: 0 additions & 16 deletions lib/copy-file.js

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion lib/cp/polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const {
ERR_FS_CP_UNKNOWN,
ERR_FS_EISDIR,
ERR_INVALID_ARG_TYPE,
} = require('../errors.js')
} = require('./errors.js')
const {
constants: {
errno: {
Expand Down
7 changes: 0 additions & 7 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
module.exports = {
...require('./fs.js'),
copyFile: require('./copy-file.js'),
cp: require('./cp/index.js'),
mkdir: require('./mkdir.js'),
mkdtemp: require('./mkdtemp.js'),
rm: require('./rm/index.js'),
withTempDir: require('./with-temp-dir.js'),
withOwner: require('./with-owner.js'),
withOwnerSync: require('./with-owner-sync.js'),
writeFile: require('./write-file.js'),
}
19 changes: 0 additions & 19 deletions lib/mkdir.js

This file was deleted.

23 changes: 0 additions & 23 deletions lib/mkdtemp.js

This file was deleted.

22 changes: 0 additions & 22 deletions lib/rm/index.js

This file was deleted.

0 comments on commit e666309

Please sign in to comment.