- Copy directory contents in parallel for better performance (#1026)
- Refactor internal code to use
async
/await
(#1020)
- Don't allow requiring
fs-extra/lib/SOMETHING
(switched toexports
) (#974) - Require Node v14.14+ (#968, #969)
- Add
fs-extra/esm
for ESM named export support; see docs for details (#746, #974) - Add promise support for
fs.readv()
(#970)
- Warn if
fs.realpath.native
does not exist, instead of erroring (#953) - Allow explicitly passing
undefined
options tomove()
(#947, #955) - Use
process.emitWarning
instead ofconsole.warn
(#954)
- Add
sideEffects: false
topackage.json
(#941)
- Require Node.js v12+ (#886, #893, #890, #894, #895)
- Allow copying broken symlinks (#779, #765, #638, #761)
The following changes, although technically semver-major, will not affect the vast majority of users:
- Ensure correct type when destination exists for
ensureLink*()
/ensureSymlink*()
(#826, #786, #870) - Error when attempting to
copy*()
unknown file type (#880) - Remove undocumented options for
remove*()
(#882)
- Allow changing case of filenames with
move*()
, even on technically case-insensitive filesystems (#759, #801) - Use native
fs.rm*()
forremove*()
in environments that support it (#882, #806) - Improve
emptyDir()
performance (#885)
- Ensure
copy*()
'sfilter
function is not called more than necessary (#883, #809) - Fix
move*()
raisingEPERM
error when moving a file to the root of a drive on Windows (#897, #819)
- Add promise support for
fs.rm()
(#841, #860) - Upgrade universalify for performance improvments (#825)
- Fix issue with
ensureFile()
when used with Jest on Windows (#804, #805) - Remove unneeded
process.umask()
call (#791) - Docs improvements (#753, #795, #797)
- Requires Node.js version 10 or greater (#725, #751)
- Switched
ensureDir*
to use a fork of https://github.com/sindresorhus/make-dir to make use of native recursivefs.mkdir
where possible (#619, #756) - Properly preserve
atime
forcopy*
withpreserveTimestamps
option (#633)
The following changes, allthough technically breaking, will not affect the vast majority of users:
outputJson
now outputs objects as they were when the function was called, even if they are mutated later (#702, #768)- Cannot pass
null
as an options parameter to*Json*
methods (#745, #768)
- Add promise shims for
fs.writev
&fs.opendir
(#747) - Better errors for
ensureFile
(#696, #744) - Better file comparison for older Node versions (#694)
- Peformance optimizations (#762, #764)
- Add missing documentation for aliases (#758, #766)
- Update
universalify
dependency (#767)
- Add support for promisified
fs.realpath.native
in Node v9.2+ (#650, #682) - Update
graceful-fs
dependency (#700) - Use
graceful-fs
everywhere (#700)
- Fix bug
Maximum call stack size exceeded
error inutil/stat
(#679)
NOTE: Node.js v6 support is deprecated, and will be dropped in the next major release.
- Use
renameSync()
under the hood inmoveSync()
- Fix bug with bind-mounted directories in
copy*()
(#613, #618) - Fix bug in
move()
with case-insensitive file systems - Use
fs.stat()
'sbigint
option incopy*()
&move*()
where possible (#657)
- Fix
removeSync()
on Windows, in some cases, it would error out withENOTEMPTY
(#646) - Document
mode
option forensureDir*()
(#587) - Don't include documentation files in npm package tarball (#642, #643)
- BREAKING: Refine
copy*()
handling of symlinks to properly detect symlinks that point to the same file. (#582) - Fix bug with copying write-protected directories (#600)
- Universalify
fs.lchmod()
(#596) - Add
engines
field topackage.json
(#580)
- Fix
fs.promises
ExperimentalWarning
on Node v10.1.0 (#578)
- Drop support for Node.js versions 4, 5, & 7 (#564)
- Rewrite
move
to usefs.rename
where possible (#549) - Don't convert relative paths to absolute paths for
filter
(#554) copy*
's behavior whenpreserveTimestamps
isfalse
has been OS-dependent since 5.0.0, but that's now explicitly noted in the docs (#563)- Fix subdirectory detection for
copy*
&move*
(#541) - Handle case-insensitive paths correctly in
copy*
(#568)
Significant refactor of copy()
& copySync()
, including breaking changes. No changes to other functions in this release.
Huge thanks to @manidlou for doing most of the work on this release.
- The
filter
option can no longer be a RegExp (must be a function). This was deprecated since fs-extra v1.0.0. #512 copy()
'sfilter
option can now be a function that returns a Promise. #518copy()
©Sync()
now usefs.copyFile()
/fs.copyFileSync()
in environments that support it (currently Node 8.5.0+). Older Node versions still get the old implementation. #505- Don't allow copying a directory into itself. #83
- Handle copying between identical files. #198
- Error out when copying an empty folder to a path that already exists. #464
- Don't create
dest
's parent if thefilter
function aborts thecopy()
operation. #517 - Fix
writeStream
not being closed if there was an error incopy()
. #516
- Fix wrong
chmod
values infs.remove()
#501 - Fix
TypeError
on systems that don't have somefs
operations likelchown
#520
- Added
EOL
option towriteJson*
&outputJson*
(via upgrade to jsonfile v4) - Added promise support to
fs.copyFile()
in Node 8.5+ - Added
.js
extension tomain
field inpackage.json
for better tooling compatibility. #485
- Previously,
ensureFile()
&ensureFileSync()
would do nothing if the path was a directory. Now, they error out for consistency withensureDir()
. #465, #466, #470
- BREAKING: The promisified versions of
fs.read()
&fs.write()
now return objects. See the docs for details. #436, #449 fs.move()
now errors out when destination is a subdirectory of source. #458- Applied upstream fixes from
rimraf
tofs.remove()
&fs.removeSync()
. #459
- Got
fs.outputJSONSync()
working again; it was broken due to refactoring. #428
Also clarified the docs in a few places.
- Fix bug in
move()
&moveSync()
when source and destination are the same, and source does not exist. #415
- BREAKING: Added Promise support. All asynchronous native fs methods and fs-extra methods now return a promise if the callback is not passed. #403
pathExists()
, a replacement for the deprecatedfs.exists
.pathExists
has a normal error-first callback signature. Also addedpathExistsSync
, an alias tofs.existsSync
, for completeness. #406
- BREAKING: Removed support for setting the default spaces for
writeJson()
,writeJsonSync()
,outputJson()
, &outputJsonSync()
. This was undocumented. #402
- Upgraded jsonfile dependency to v3.0.0:
- BREAKING: Changed behavior of
throws
option forreadJsonSync()
; now does not throw filesystem errors whenthrows
isfalse
.
- BREAKING: Changed behavior of
- BREAKING:
writeJson()
,writeJsonSync()
,outputJson()
, &outputJsonSync()
now output minified JSON by default for consistency withJSON.stringify()
; set thespaces
option to2
to override this new behavior. #402 - Use
Buffer.allocUnsafe()
instead ofnew Buffer()
in environments that support it. #394
removeSync()
silently failed on Windows in some cases. Now throws anEBUSY
error. #408
- Weird windows bug that resulted in
ensureDir()
's callback being called twice in some cases. This bug may have also affectedremove()
. See #392, #393
- Reverted
5597bd
, this broke compatibility with Node.js versions v4+ but less thanv4.5.0
. - Remove
Buffer.alloc()
usage inmoveSync()
.
Thanks to Mani Maghsoudlou (@manidlou) & Jan Peer Stöcklmair (@JPeer264) for their extraordinary help with this release!
moveSync()
See #309, #381. (@manidlou)copy()
andcopySync()
'sfilter
option now gets the destination path passed as the second parameter. #366 (@manidlou)
- Use
Buffer.alloc()
instead of deprecatednew Buffer()
incopySync()
. #380 (@manidlou) - Refactored entire codebase to use ES6 features supported by Node.js v4+ #355. (@JPeer264)
- Refactored docs. (@manidlou)
- BREAKING: Removed support for Node
v0.12
. The Node foundation stopped officially supporting it on Jan 1st, 2017. - BREAKING: Remove
walk()
andwalkSync()
.walkSync()
was only part offs-extra
for a little over two months. Use klaw instead ofwalk()
, in fact,walk()
was just an alias to klaw. ForwalkSync()
use klaw-sync. See: #338, #339
- BREAKING: Renamed
clobber
tooverwrite
. This affectscopy()
,copySync()
, andmove()
. #330, #333 - Moved docs, to
docs/
. #340
- Apply filters to directories in
copySync()
like incopy()
. #324 - A specific condition when disk is under heavy use,
copy()
can fail. #326
After five years of development, we finally have reach the 1.0.0 milestone! Big thanks goes to Ryan Zim for leading the charge on this release!
walkSync()
- BREAKING: dropped Node v0.10 support.
- disabled
rimaf
globbing, wasn't used. #280 - deprecate
copy()/copySync()
optionfilter
if it's aRegExp
.filter
should now be a function. - inline
rimraf
. This is temporary and was done becauserimraf
depended upon the beefyglob
whichfs-extra
does not use. #300
- bug fix proper closing of file handle on
utimesMillis()
#271 - proper escaping of files with dollar signs #291
copySync()
failed if user didn't own file. #199, #301
- Brought back Node v0.10 support. I didn't realize there was still demand. Official support will end 2016-10-01.
- BREAKING: removed support for Node v0.10. If you still want to use Node v0.10, everything should work except for
ensureLink()/ensureSymlink()
. Node v0.12 is still supported but will be dropped in the near future as well.
- BREAKING: removed
createOutputStream()
. Use https://www.npmjs.com/package/create-output-stream. See: #192 mkdirs()/mkdirsSync()
check for invalid win32 path chars. See: #209, #237mkdirs()/mkdirsSync()
if drive not mounted, error. See: #93
- add
dereference
option tocopySync()
. #235
- fixed
copy()
if source and dest are the same. #230
- fixed if
emptyDir()
does not have a callback: #229
copy()
with two arguments (w/o callback) was broken. See: #215
copySync()
madepreserveTimestamps
default consistent withcopy()
which isfalse
. See: #208
- fixed
copy()
hangup in copying blockDevice / characterDevice //dev/null
. See: #193
- fixed
outputJson{Sync}()
spacing adherence tofs.spaces
- fixed
copySync()
whenclogger=true
and the destination is read only. See: #190
- extracted the
walk()
function into its own moduleklaw
.
- now has a file walker
walk()
- removed alias
delete()
anddeleteSync()
. See: #171
- Better handling of errors for
move()
when moving across devices. #170 ensureSymlink()
andensureLink()
should not throw errors if link exists. #169
- added
ensureLink{Sync}()
andensureSymlink{Sync}()
. See: #165
- Prevent calling
hasMillisResSync()
on module load. See: #149. Fixes regression that was introduced in0.21.0
.
- preserve permissions / ownership in
copy()
. See: #54
- add option to preserve timestamps in
copy()
andcopySync()
. See: #141 - updated
[email protected]
to4.x
. This brings in features fromamazing-graceful-fs
(much cleaner code / less hacks)
- fixed regression caused by latest jsonfile update: See: jprichardson/node-jsonfile#26
- removed
jsonfile
aliases withFile
in the name, they weren't documented and probably weren't in use e.g. this package had bothfs.readJsonFile
andfs.readJson
that were aliases to each other, now usefs.readJson
. - preliminary walker created. Intentionally not documented. If you use it, it will almost certainly change and break your code.
- started moving tests inline
- upgraded to
[email protected]
, can now pass JSON revivers/replacers toreadJson()
,writeJson()
,outputJson()
fs.copy()
had support for Node v0.8, dropped support
- fixed license field according to this: #136 and https://github.com/npm/npm/releases/tag/v2.10.0
- bugfix: handle
EEXIST
when clobbering on some Linux systems. #134
- bugfix: allow
F_OK
(#120)
- improved windows support for
move()
a bit. https://github.com/jprichardson/node-fs-extra/commit/92838980f25dc2ee4ec46b43ee14d3c4a1d30c1b - fixed a lot of tests for Windows (appveyor)
- added
emptyDir()
andemptyDirSync()
copySync
addedclobber
option (before always would clobber, now ifclobber
isfalse
it throws an error if the destination exists). Only works with files at the moment.createOutputStream()
added. See: #118
- fixed
fs.move
whenclobber
istrue
and destination is a directory, it should clobber. #114
fs.mkdirs
fix infinite loop on Windows. See: See https://github.com/substack/node-mkdirp/pull/74 and https://github.com/substack/node-mkdirp/issues/66
- reverted https://github.com/jprichardson/node-fs-extra/commit/1ee77c8a805eba5b99382a2591ff99667847c9c9
- fixed
fs.copy
for Node v0.8 (support is temporary and will be removed in the near future)
- if
setImmediate
is not available, fall back toprocess.nextTick
- bugfix
fs.move()
into itself. Closes #104 - bugfix
fs.move()
moving directory across device. Closes #108 - added coveralls support
- bugfix: nasty multiple callback
fs.copy()
bug. Closes #98 - misc fs.copy code cleanups
- dropped
ncp
, imported code in - because of previous, now supports
io.js
graceful-fs
is now a dependency
- changed
copy
/copySync
fromfs.copy(src, dest, [filters], callback)
tofs.copy(src, dest, [options], callback)
#100 - removed mockfs tests for mkdirp (this may be temporary, but was getting in the way of other tests)
- removed
touch
andtouchSync
methods (they didn't handle permissions like UNIX touch) - updated
"ncp": "^0.6.0"
to"ncp": "^1.0.1"
- imported
mkdirp
=>minimist
andmkdirp
are no longer dependences, should now appease people who wantedmkdirp
to be--use_strict
safe. See #59
- copy symlinks in
copySync()
#85
- bugfix
copySync()
preserve file permissions #80
- upgraded
"ncp": "^0.5.1"
to"ncp": "^0.6.0"
- upgrade
jsonfile": "^1.2.0"
tojsonfile": "^2.0.0"
=> on write, json files now have\n
at end. Also addsoptions.throws
toreadJsonSync()
see https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options for more details.
- bugfix: upgaded
"jsonfile": "~1.1.0"
to"jsonfile": "^1.2.0"
, bumped minor because ofjsonfile
dep change from~
to^
. #67
- removed Node.js
0.8.x
support,0.9.0
was published moments ago and should have been done there
- upgraded
ncp
from~0.4.2
to^0.5.1
, #58 - upgraded
rimraf
from~2.2.6
to^2.2.8
- upgraded
mkdirp
from0.3.x
to^0.5.0
- added methods
ensureFile()
,ensureFileSync()
- added methods
ensureDir()
,ensureDirSync()
#31 - added
move()
method. From: https://github.com/andrewrk/node-mv
filter
implemented oncopy()
andcopySync()
. (Srirangan / #36)
copySync()
implemented (Srirangan / #33)- updated to the latest
jsonfile
version1.1.0
which givesoptions
params for the JSON methods. Closes #32
- update readme conventions
copy()
now works if destination directory does not exist. Closes #29
- changed
homepage
field in package.json to remove NPM warning
- changed JSON spacing default from
4
to2
to follow Node conventions - updated
jsonfile
dep - updated
rimraf
dep
- added .npmignore, #25
- removed node 0.6 support
- added node 0.10 support
- upgraded to latest
ncp
andrimraf
. - optional
graceful-fs
support. Closes #17
- Removed
readTextFile
. - Renamed
readJSONFile
toreadJSON
andreadJson
, same with write. - Restructured documentation a bit. Added roadmap.
- Set default spaces in
jsonfile
from 4 to 2. - Updated
testutil
deps for tests. - Renamed
touch()
tocreateFile()
- Added
outputFile()
andoutputFileSync()
- Changed creation of testing diretories so the /tmp dir is not littered.
- Added
readTextFile()
andreadTextFileSync()
.
- Added
touch()
andtouchSync()
methods.
- Fixed some stray globals.
- Removed all CoffeeScript from tests.
- Renamed
mkdir
tomkdirs
/mkdirp
.
- Updated
rimraf
dep.
- Rewrote module into JavaScript. (Must still rewrite tests into JavaScript)
- Added all methods of jsonfile
- Added Travis-CI.
- Added method
readJSONFile
.
- Bug fix:
deleteSync()
didn't exist. - Verified Node v0.8 compatibility.
- Fixed bug in
remove()
/delete()
that wouldn't execute the function if a callback wasn't passed.
- Renamed
copyFile()
tocopy()
.copy()
can now copy directories (recursively) too. - Renamed
rmrf()
toremove()
. remove()
aliased withdelete()
.- Added
mkdirp
capabilities. Named:mkdir()
. Hides Node.js nativemkdir()
. - Instead of exporting the native
fs
module with new functions, I now copy over the native methods to a new object and export that instead.
- Removed CoffeeScript dependency
- Added methods rmrf and rmrfSync
- Moved tests from Jasmine to Mocha