Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove owner related code as well as stale polyfills #53

Merged
merged 1 commit into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading