1070 Commits

Author SHA1 Message Date
Ryan Zimmerman
05d2e93d99
BREAKING: Remove special handling of fs.promises (#890)
* Remove special handling of fs.promises

Refs #886

* Fix tests
2021-04-30 16:19:58 -04:00
Ryan Zimmerman
d8c93b8978
BREAKING: Drop Node 10 support (#893)
* BREAKING: Drop Node 10 support

* Don't test Node 16 on AppVeyor, because it's not supported

* package.json engines
2021-04-30 16:19:25 -04:00
Ryan Zimmerman
ce29957eec
Clarify move*() docs (#888)
Fixes #830
2021-04-17 15:48:24 -04:00
Ryan Zimmerman
af354012a6
Ensure copy filter fn is not called more than needed (#883)
Fixes #809
2021-04-16 13:01:52 -04:00
Ryan Zimmerman
c8815e3ccf
BREAKING: Use fs.rm/rmSync where supported (#882)
Fixes #806

Technically a breaking change since this removes the undocumented
ability to pass options to remove*()
2021-04-08 13:36:04 -04:00
Ryan Zimmerman
24731f171f
Clarify docs for copy*() filter (#884)
* Clarify docs for copy*() filter

Fixes #843

* Implement suggestion

https://github.com/jprichardson/node-fs-extra/pull/884#discussion_r608216178
2021-04-08 13:35:47 -04:00
Ryan Zimmerman
f4a880d29c
Remove check for fs.realpath.native support, since it's everywhere (#887) 2021-04-06 09:02:26 -04:00
Ryan Zimmerman
04282cd888
Convert emptyDir() to async function; remove items in parallel (#885) 2021-04-06 09:02:07 -04:00
Ryan Zimmerman
2fca5b213c
BREAKING: copy*(): Error when unknown file type is encountered (#880)
Replaces & closes #812
2021-04-02 07:52:47 -04:00
Ryan Zimmerman
452352686e
BREAKING: Ensure existing dest correct type/target in ensureLink/Symlink (#826)
Fixes #786
Fixes #870
2021-04-02 07:52:13 -04:00
Mani Maghsoudlou
c8bd3830fc move: support changing case in case-insensitive systems (#801)
Resolves #759
2021-04-01 16:26:01 -04:00
Mani Maghsoudlou
f21048b21d BREAKING: copy*(): allow copying broken symlinks (#779) 2021-04-01 16:13:21 -04:00
Anton
7498c9c9eb
Improve code quality (#873) 2021-03-15 10:43:45 -04:00
Ryan Zimmerman
1625838cdf 9.1.0 9.1.0 2021-01-19 11:56:33 -05:00
Сковорода Никита Андреевич
76d38fc127
tests: fix birthtime not available on tmpfs on Linux (#861) 2021-01-19 10:09:24 -05:00
Ryan Zimmerman
d409cf8a4a
Add promise support for fs.rm() (#860)
Fixes #841
2021-01-19 09:51:08 -05:00
Ryan Zimmerman
6bffcd8188
Upgrade universalify (#825)
No breaking changes for us, just performance improvements
2020-07-29 14:09:17 -04:00
Pierre Raoul
96facaae98
Docs: add fse-cli to the README (#815) 2020-06-17 16:21:32 -04:00
Ryan Zimmerman
7b12b058e2 9.0.1 9.0.1 2020-06-03 19:59:30 -04:00
Federico Bozzini
f86c09949c
Do not check errors with instanceof (#805)
This fixes cross-VM type issues in Jest.

Backport of aa50e0298f
2020-06-03 16:11:23 -04:00
Ryan Zimmerman
28173ed31b
Fix tests on Node 14 (#800)
* Fix tests on Node 14

Fixes #798

writeFileSync requires a data parameter

* Add Node 14 to CI
2020-05-14 10:24:23 -04:00
Mani Maghsoudlou
957e1c3fa2
Update issue template (#799) 2020-05-13 20:55:34 -04:00
Mani Maghsoudlou
1680dff87f
consistentify types in docs (#797) 2020-05-13 09:19:03 -04:00
Mani Maghsoudlou
b0eb751a75
Improve docs (#795)
* improve docs

* Update docs/ensureSymlink-sync.md

Co-authored-by: Ryan Zimmerman <17342435+RyanZim@users.noreply.github.com>

* Update docs/ensureSymlink.md

Co-authored-by: Ryan Zimmerman <17342435+RyanZim@users.noreply.github.com>

* add Error type to docs

Co-authored-by: Ryan Zimmerman <17342435+RyanZim@users.noreply.github.com>
2020-05-11 16:40:39 -04:00
Ryan Zimmerman
a2738d3906
Don't use deprecated process.umask() (#791)
* Don't use deprecated process.umask()

Refs https://github.com/sindresorhus/make-dir/issues/27

* Remove unneeded umask tests

No need to test Node.js core's behavior (which is all these tests do)
2020-04-24 07:32:54 -04:00
Jan Peer Stöcklmair
934ea759ad
Docs: add hint for supported Node.js version (#777) 2020-03-26 10:02:41 -04:00
Ryan Zimmerman
a571007f70 9.0.0 9.0.0 2020-03-19 10:22:04 -04:00
Ryan Zimmerman
a149f822c3
JSON updates (#768)
* Upgrade jsonfile

Fixes #745

* Test from main entry point

* Make outputJson() mutation-proof

Fixes #702

* Update outputJsonSync() to match async implementation
2020-03-11 15:18:23 -04:00
Ryan Zimmerman
92388f2e1d
Upgrade universalify (#767) 2020-03-06 19:45:41 -05:00
Ryan Zimmerman
223eb896c4
Document all create*() aliases for ensure*() methods (#766)
Fixes #758
2020-02-26 09:19:28 -05:00
Ryan Zimmerman
ab92b24370
BREAKING: Use internal fork of make-dir for mkdirs implementation (#756)
* BREAKING: Use internal fork of make-dir for mkdirs implementation

Resolves #619

Everything should work similarly to how it did before; except that
we no longer return a file path on success (to match fs.mkdir).
Also, errors may be different.

* Hopefully fix Windows tests

- Error codes are different
- Match fs.mkdir behavior on Windows when creating root

* Port https://github.com/sindresorhus/make-dir/pull/24

* Add comment for clarity

* Use at-least-node for version sniffing

* Consistent error codes across OSes

* Allow different error codes on different Node versions
2020-02-18 11:41:04 -05:00
Ryan Zimmerman
075c2d1016
Refactor internal stat utils (#764)
* Refactor internal getStats() util

Fixes #762

* Proper promise tests for copy()

Our hacky tests don't play well with multiple layers of
callback/promise switching

* Simplify internal checkParentPaths()

* Port improvments to sync methods
2020-02-17 08:17:31 -05:00
Ryan Zimmerman
ce41762771
Don't generate package-lock.json; instead of just ignoring it (#763)
Lockfiles are an anti-pattern for libraries; we don't check ours
into git, but it's preferable not to even use one.
2020-02-17 08:17:11 -05:00
Ryan Zimmerman
cdc7745c9f
Use at-least-node instead of homespun version sniffing (#760)
* Use at-least-node instead of homespun version sniffing

* Remove semver devDep; use at-least-node in tests
2020-02-13 17:31:21 -05:00
Ryan Zimmerman
9bfd380021
Cleanup lib/util/ to remove unused code (#757)
Move function only used in tests to test files to avoid bundling it
2020-02-06 21:14:38 -05:00
Mani Maghsoudlou
3120c5cebf
copy*(): remove copyFileFallback (#755)
* copy: remove copyFileFallback

* copy-sync: remove copyFileFallback
2020-02-06 16:00:32 -05:00
Ryan Zimmerman
3c3865cad8
BREAKING: Drop old Node support (#751)
* BREAKING: Drop old Node support, require v10+

Update CI configs

* Remove references and test fencing for old Node versions

* Use object spread properties

* Use octal literal notation

* Use optional catch bindings
2020-02-04 17:30:40 -05:00
Maxime Bargiel
3dac36047a
Update dest atime after copy/copy-sync (#633) 2020-02-04 17:17:23 -05:00
Ryan Zimmerman
a6b1a441ef
Remove unused done param (#749)
Not sure why linter didn't catch this
2020-02-03 09:33:26 -05:00
Ryan Zimmerman
2e4fcaee51
Update fs promise shims to support latest Node functions (#747)
* Add promise support for fs.writev()

* Add promise support for fs.opendir()

Sort array to match Node docs

* Fix tests for fs.writev()

* Fix requested changes
2020-02-03 09:33:14 -05:00
Ryan Zimmerman
a6c1547899
Switch from istanbul to nyc (#748) 2020-02-01 09:56:27 -05:00
Ryan Zimmerman
5d3f53325e
Improve ensurefile error (#744)
* Check createFileSync gives clear error if node in directory tree is a file

* Make error code check work in Node.js 6

* Throw ENOTDIR error when dir doesn't exist

* Add test for createFile

* Throw ENOTDIR error when dir doesn't exist for makeFile async

* Make stat call on parent directory instead of first checking exists

Co-authored-by: Luke Childs <lukechilds123@gmail.com>
2020-01-31 16:27:31 -05:00
nacd
76e48cb43f
fix a flaky test in ncp.test.js (#737) 2020-01-30 13:33:46 -05:00
nacd
d6478d2217 fix flaky test in remove.test.js (#736) 2019-12-13 10:06:20 -05:00
Daniel Cassidy
2b97fe3e50 Add "promise" to keywords on npm (#730)
fs-extra is probably the most popular promise-supporting fs
library on npm, but if you search npmjs.com for "fs promise",
it doesn’t even show up. This change should hopefully fix
that :-).
2019-10-28 10:01:43 -04:00
Tomoaki Abe
d1a01e735e Upgrade 'standard' and run 'standard --fix' (#720)
* Upgrade 'standard' and run 'standard --fix'

* Fix with double quotes

If single quotes are included, enclose them in double quotes.
2019-09-06 11:23:34 -04:00
Mani Maghsoudlou
e3d1ab855a
Merge pull request #694 from mbargiel/feature/stats-heuristics-without-bigint
Add heuristics to stats.ino comparison when bigint is not available
2019-07-30 09:46:02 -07:00
Maxime Bargiel
391fb7365e Add heuristics to stats.ino comparison when bigint is not available 2019-07-27 13:32:18 -04:00
Tomoaki Abe
ca58cbc09f Upgrade 'standard' (#709)
I have fixed the following error.

```
  node-fs-extra/lib/ensure/symlink-paths.js:37:9: Unnecessarily quoted property 'toCwd' found.
  node-fs-extra/lib/ensure/symlink-paths.js:38:9: Unnecessarily quoted property 'toDst' found.
  node-fs-extra/lib/ensure/symlink-paths.js:48:11: Unnecessarily quoted property 'toCwd' found.
  node-fs-extra/lib/ensure/symlink-paths.js:49:11: Unnecessarily quoted property 'toDst' found.
  node-fs-extra/lib/ensure/symlink-paths.js:58:13: Unnecessarily quoted property 'toCwd' found.
  node-fs-extra/lib/ensure/symlink-paths.js:59:13: Unnecessarily quoted property 'toDst' found.
  node-fs-extra/lib/ensure/symlink-paths.js:73:7: Unnecessarily quoted property 'toCwd' found.
  node-fs-extra/lib/ensure/symlink-paths.js:74:7: Unnecessarily quoted property 'toDst' found.
  node-fs-extra/lib/ensure/symlink-paths.js:82:9: Unnecessarily quoted property 'toCwd' found.
  node-fs-extra/lib/ensure/symlink-paths.js:83:9: Unnecessarily quoted property 'toDst' found.
  node-fs-extra/lib/ensure/symlink-paths.js:89:9: Unnecessarily quoted property 'toCwd' found.
  node-fs-extra/lib/ensure/symlink-paths.js:90:9: Unnecessarily quoted property 'toDst' found.
  node-fs-extra/lib/mkdirs/__tests__/clobber.test.js:22:18: There should be no space after '['.
  node-fs-extra/lib/mkdirs/__tests__/clobber.test.js:22:29: There should be no space before ']'.
  node-fs-extra/lib/mkdirs/__tests__/race.test.js:24:18: There should be no space after '['.
  node-fs-extra/lib/mkdirs/__tests__/race.test.js:24:29: There should be no space before ']'.
```
2019-07-11 10:52:31 -04:00
Ryan Zimmerman
b7df7cce3f 8.1.0 8.1.0 2019-06-28 12:24:41 -04:00