Repository: jprichardson/node-fs-extra
Pull request #378 (2017-03-03 22:27:06)

Don't move when source and dest paths are the same.
This PR addresses #377 to avoid a move operation if the `source` and `dest` paths are the same.

*(I'll add tests too, just wanted to get the ball rolling)*

coveralls: 
[![Coverage Status](https://coveralls.io/builds/10426652/badge)](https://coveralls.io/builds/10426652)

Coverage decreased (-0.08%) to 85.352% when pulling **50ecc8fb830e65596835efff2fc3e7ebd182e177 on jdalton:move-check** into **e771770a7f58853a97d19b92fa191db68023cf63 on jprichardson:master**.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/10458681/badge)](https://coveralls.io/builds/10458681)

Coverage decreased (-0.09%) to 79.435% when pulling **b74cf5bfa53c53571f5d8763f639e3fbc3ffce05 on jdalton:move-check** into **e06440b6b40ecdb4ec1c789e0f77a387806a5566 on jprichardson:master**.

jprichardson: Before the behavior would error out, right? Should we consider this breaking? Thoughts @jdalton?
jdalton: It did error out. I would consider this a bug fix. *(I haven't forgotten about the unit tests, just busy)*
manidlou: What should be the correct behavior then? Since whatever that'd be, the same behavior should be applied to `moveSync` as well.
jdalton: >What should be the correct behavior then? Since whatever that'd be, the same behavior should be applied to `moveSync` as well.

I'm asserting by the title and behavior of this PR "Don't move when source and dest paths are the same."

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4ef6153..7f810c8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,16 +1,14 @@
-2.1.0 / 2017-03-14
-------------------
-
-Thanks to [Mani Maghsoudlou (@manidlou)](https://github.com/manidlou) & [Jan Peer Stöcklmair (@JPeer264)](https://github.com/JPeer264) for their extraordinary help with this release!
+Unreleased
+----------
 
 ### Added
-- `moveSync()` See [#309], [#381]. ([@manidlou](https://github.com/manidlou))
-- `copy()` and `copySync()`'s `filter` option now gets the destination path passed as the second parameter. [#366] ([@manidlou](https://github.com/manidlou))
+
+### Removed
 
 ### Changed
-- Use `Buffer.alloc()` instead of deprecated `new Buffer()` in `copySync()`. [#380] ([@manidlou](https://github.com/manidlou))
-- Refactored entire codebase to use ES6 features supported by Node.js v4+ ([#355]). [(@JPeer264)](https://github.com/JPeer264)
-- Refactored docs. ([@manidlou](https://github.com/manidlou))
+
+### Fixed
+
 
 2.0.0 / 2017-01-16
 ------------------
diff --git a/README.md b/README.md
index cee4399..445b041 100644
--- a/README.md
+++ b/README.md
@@ -85,38 +85,31 @@ try {
 
 Methods
 -------
-
-### Async
-
 - [copy](docs/copy.md)
+- [copySync](docs/copy.md)
 - [emptyDir](docs/emptyDir.md)
+- [emptyDirSync](docs/emptyDir.md)
 - [ensureFile](docs/ensureFile.md)
+- [ensureFileSync](docs/ensureFile.md)
 - [ensureDir](docs/ensureDir.md)
+- [ensureDirSync](docs/ensureDir.md)
 - [ensureLink](docs/ensureLink.md)
+- [ensureLinkSync](docs/ensureLink.md)
 - [ensureSymlink](docs/ensureSymlink.md)
+- [ensureSymlinkSync](docs/ensureSymlink.md)
 - [mkdirs](docs/ensureDir.md)
+- [mkdirsSync](docs/ensureDir.md)
 - [move](docs/move.md)
 - [outputFile](docs/outputFile.md)
+- [outputFileSync](docs/outputFile.md)
 - [outputJson](docs/outputJson.md)
+- [outputJsonSync](docs/outputJson.md)
 - [readJson](docs/readJson.md)
+- [readJsonSync](docs/readJson.md)
 - [remove](docs/remove.md)
+- [removeSync](docs/remove.md)
 - [writeJson](docs/writeJson.md)
-
-### Sync
-
-- [copySync](docs/copy-sync.md)
-- [emptyDirSync](docs/emptyDir-sync.md)
-- [ensureFileSync](docs/ensureFile-sync.md)
-- [ensureDirSync](docs/ensureDir-sync.md)
-- [ensureLinkSync](docs/ensureLink-sync.md)
-- [ensureSymlinkSync](docs/ensureSymlink-sync.md)
-- [mkdirsSync](docs/ensureDir-sync.md)
-- [moveSync](docs/move-sync.md)
-- [outputFileSync](docs/outputFile-sync.md)
-- [outputJsonSync](docs/outputJson-sync.md)
-- [readJsonSync](docs/readJson-sync.md)
-- [removeSync](docs/remove-sync.md)
-- [writeJsonSync](docs/writeJson-sync.md)
+- [writeJsonSync](docs/writeJson.md)
 
 
 **NOTE:** You can still use the native Node.js methods. They are copied over to `fs-extra`.
diff --git a/docs/copy-sync.md b/docs/copy-sync.md
deleted file mode 100644
index 8e61c2b..0000000
--- a/docs/copy-sync.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# copySync(src, dest, [options])
-
-Copy a file or directory. The directory can have contents. Like `cp -r`.
-
-- `src` `<String>`
-- `dest` `<String>`
-- `options` `<Object>`
-  - `overwrite` `<boolean>`: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior.
-  - `errorOnExist` `<boolean>`: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`.
-  - `dereference` `<boolean>`: dereference symlinks, default is `false`.
-  - `preserveTimestamps` `<boolean>`: will set last modification and access times to the ones of the original source files, default is `false`.
-  - `filter` `<Function>`: Function to filter copied files. Return `true` to include, `false` to exclude. This can also be a RegExp, however this is deprecated (See [issue #239](https://github.com/jprichardson/node-fs-extra/issues/239) for background).
-
-## Example:
-
-```js
-const fs = require('fs-extra')
-
-// copy file
-fs.copySync('/tmp/myfile', '/tmp/mynewfile')
-
-// copy directory, even if it has subdirectories or files
-fs.copySync('/tmp/mydir', '/tmp/mynewdir')
-```
-
-**Using filter function**
-
-```js
-const fs = require('fs-extra')
-
-const filterFunc = (src, dest) => {
-  // your logic here
-  // it will be copied if return true
-}
-
-fs.copySync('/tmp/mydir', '/tmp/mynewdir', { filter: filterFunc })
-```
diff --git a/docs/copy.md b/docs/copy.md
index a4f75e9..dac7629 100644
--- a/docs/copy.md
+++ b/docs/copy.md
@@ -2,15 +2,14 @@
 
 Copy a file or directory. The directory can have contents. Like `cp -r`.
 
-- `src` `<String>`
-- `dest` `<String>`
-- `options` `<Object>`
-  - `overwrite` `<boolean>`: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior.
-  - `errorOnExist` `<boolean>`: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`.
-  - `dereference` `<boolean>`: dereference symlinks, default is `false`.
-  - `preserveTimestamps` `<boolean>`: will set last modification and access times to the ones of the original source files, default is `false`.
-  - `filter` `<Function>`: Function to filter copied files. Return `true` to include, `false` to exclude. This can also be a RegExp, however this is deprecated (See [issue #239](https://github.com/jprichardson/node-fs-extra/issues/239) for background).
-- `callback` `<Function>`
+**Sync:** `copySync()`
+
+## Options:
+- overwrite (boolean): overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior.
+- errorOnExist (boolean): when `overwrite` is `false` and the destination exists, throw an error. Default is `false`.
+- dereference (boolean): dereference symlinks, default is `false`.
+- preserveTimestamps (boolean): will set last modification and access times to the ones of the original source files, default is `false`.
+- filter: Function to filter copied files. Return `true` to include, `false` to exclude. This can also be a RegExp, however this is deprecated (See [issue #239](https://github.com/jprichardson/node-fs-extra/issues/239) for background).
 
 ## Example:
 
diff --git a/docs/emptyDir-sync.md b/docs/emptyDir-sync.md
deleted file mode 100644
index 7decdbc..0000000
--- a/docs/emptyDir-sync.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# emptyDirSync(dir)
-
-Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted.
-
-**Alias:** `emptydirSync()`
-
-- `dir` `<String>`
-
-## Example:
-
-```js
-const fs = require('fs-extra')
-
-// assume this directory has a lot of files and folders
-fs.emptyDirSync('/tmp/some/dir')
-```
diff --git a/docs/emptyDir.md b/docs/emptyDir.md
index 43292e3..d5987e7 100644
--- a/docs/emptyDir.md
+++ b/docs/emptyDir.md
@@ -4,8 +4,7 @@ Ensures that a directory is empty. Deletes directory contents if the directory i
 
 **Alias:** `emptydir()`
 
-- `dir` `<String>`
-- `callback` `<Function>`
+**Sync:** `emptyDirSync()`, `emptydirSync()`
 
 ## Example:
 
diff --git a/docs/ensureDir-sync.md b/docs/ensureDir-sync.md
deleted file mode 100644
index 8f083d2..0000000
--- a/docs/ensureDir-sync.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# ensureDirSync(dir)
-
-Ensures that the directory exists. If the directory structure does not exist, it is created. Like `mkdir -p`.
-
-**Aliases:** `mkdirsSync()`, `mkdirpSync()`
-
-- `dir` `<String>`
-
-## Example:
-
-```js
-const fs = require('fs-extra')
-
-const dir = '/tmp/this/path/does/not/exist'
-fs.ensureDirSync(dir)
-// dir has now been created, including the directory it is to be placed in
-```
diff --git a/docs/ensureDir.md b/docs/ensureDir.md
index 1f8acfb..9a3015c 100644
--- a/docs/ensureDir.md
+++ b/docs/ensureDir.md
@@ -4,8 +4,7 @@ Ensures that the directory exists. If the directory structure does not exist, it
 
 **Aliases:** `mkdirs()`, `mkdirp()`
 
-- `dir` `<String>`
-- `callback` `<Function>`
+**Sync:** `ensureDirSync()`, `mkdirsSync()`, `mkdirpSync()`
 
 ## Example:
 
diff --git a/docs/ensureFile-sync.md b/docs/ensureFile-sync.md
deleted file mode 100644
index 25ac39d..0000000
--- a/docs/ensureFile-sync.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# ensureFileSync(file)
-
-Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**.
-
-**Alias:** `createFileSync()`
-
-- `file` `<String>`
-
-## Example:
-
-```js
-const fs = require('fs-extra')
-
-const file = '/tmp/this/path/does/not/exist/file.txt'
-fs.ensureFileSync(file)
-// file has now been created, including the directory it is to be placed in
-```
diff --git a/docs/ensureFile.md b/docs/ensureFile.md
index 1567e60..b94d0e2 100644
--- a/docs/ensureFile.md
+++ b/docs/ensureFile.md
@@ -4,8 +4,7 @@ Ensures that the file exists. If the file that is requested to be created is in
 
 **Alias:** `createFile()`
 
-- `file` `<String>`
-- `callback` `<Function>`
+**Sync:** `createFileSync()`,`ensureFileSync()`
 
 ## Example:
 
diff --git a/docs/ensureLink-sync.md b/docs/ensureLink-sync.md
deleted file mode 100644
index 74769d3..0000000
--- a/docs/ensureLink-sync.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# ensureLinkSync(srcpath, dstpath)
-
-Ensures that the link exists. If the directory structure does not exist, it is created.
-
-- `srcpath` `<String>`
-- `dstpath` `<String>`
-
-## Example:
-
-```js
-const fs = require('fs-extra')
-
-const srcpath = '/tmp/file.txt'
-const dstpath = '/tmp/this/path/does/not/exist/file.txt'
-fs.ensureLinkSync(srcpath, dstpath)
-// link has now been created, including the directory it is to be placed in
-```
diff --git a/docs/ensureLink.md b/docs/ensureLink.md
index 3cf38c5..69cbb24 100644
--- a/docs/ensureLink.md
+++ b/docs/ensureLink.md
@@ -2,9 +2,7 @@
 
 Ensures that the link exists. If the directory structure does not exist, it is created.
 
-- `srcpath` `<String>`
-- `dstpath` `<String>`
-- `callback` `<Function>`
+**Sync:** `ensureLinkSync()`
 
 ## Example:
 
diff --git a/docs/ensureSymlink-sync.md b/docs/ensureSymlink-sync.md
deleted file mode 100644
index 328d4c4..0000000
--- a/docs/ensureSymlink-sync.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# ensureSymlinkSync(srcpath, dstpath, [type])
-
-Ensures that the symlink exists. If the directory structure does not exist, it is created.
-
-- `srcpath` `<String>`
-- `dstpath` `<String>`
-- `type` `<String>`
-
-## Example:
-
-```js
-const fs = require('fs-extra')
-
-const srcpath = '/tmp/file.txt'
-const dstpath = '/tmp/this/path/does/not/exist/file.txt'
-fs.ensureSymlinkSync(srcpath, dstpath)
-// symlink has now been created, including the directory it is to be placed in
-```
diff --git a/docs/ensureSymlink.md b/docs/ensureSymlink.md
index b6c9695..8240e1f 100644
--- a/docs/ensureSymlink.md
+++ b/docs/ensureSymlink.md
@@ -2,10 +2,7 @@
 
 Ensures that the symlink exists. If the directory structure does not exist, it is created.
 
-- `srcpath` `<String>`
-- `dstpath` `<String>`
-- `type` `<String>`
-- `callback` `<Function>`
+**Sync:** `ensureSymlinkSync()`
 
 ## Example:
 
diff --git a/docs/move-sync.md b/docs/move-sync.md
deleted file mode 100644
index cd701fe..0000000
--- a/docs/move-sync.md
+++ /dev/null
@@ -1,24 +0,0 @@
-# moveSync(src, dest, [options])
-
-Moves a file or directory, even across devices.
-
-- `src` `<String>`
-- `dest` `<String>`
-- `options` `<Object>`
-  - `overwrite` `<boolean>`: overwrite existing file or directory, default is `false`.
-
-## Example:
-
-```js
-const fs = require('fs-extra')
-
-fs.moveSync('/tmp/somefile', '/tmp/does/not/exist/yet/somefile')
-```
-
-**Using `overwrite` option**
-
-```js
-const fs = require('fs-extra')
-
-fs.moveSync('/tmp/somedir', '/tmp/may/already/existed/somedir', { overwrite: true })
-```
diff --git a/docs/move.md b/docs/move.md
index 547af7c..c7dc77e 100644
--- a/docs/move.md
+++ b/docs/move.md
@@ -2,11 +2,8 @@
 
 Moves a file or directory, even across devices.
 
-- `src` `<String>`
-- `dest` `<String>`
-- `options` `<Object>`
-  - `overwrite` `<boolean>`: overwrite existing file or directory, default is `false`.
-- `callback` `<Function>`
+## Options:
+- overwrite (boolean): overwrite existing file or directory, default is `false`
 
 ## Example:
 
@@ -19,15 +16,3 @@ fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile', err => {
   console.log('success!')
 })
 ```
-
-**Using `overwrite` option**
-
-```js
-const fs = require('fs-extra')
-
-fs.move('/tmp/somedir', '/tmp/may/already/existed/somedir', { overwrite: true }, err => {
-  if (err) return console.error(err)
-
-  console.log('success!')
-})
-```
diff --git a/docs/outputFile-sync.md b/docs/outputFile-sync.md
deleted file mode 100644
index 38eee8b..0000000
--- a/docs/outputFile-sync.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# outputFileSync(file, data, [options])
-
-Almost the same as `writeFileSync` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `file` must be a file path (a buffer or a file descriptor is not allowed). `options` are what you'd pass to [`fs.writeFileSync()`](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options).
-
-- `file` `<String>`
-- `data` `<String> | <Buffer> | <Uint8Array>`
-- `options` `<Object> | <String>`
-
-## Example:
-
-```js
-const fs = require('fs-extra')
-
-const file = '/tmp/this/path/does/not/exist/file.txt'
-fs.outputFileSync(file, 'hello!')
-
-const data = fs.readFileSync(file, 'utf8')
-console.log(data) // => hello!
-```
diff --git a/docs/outputFile.md b/docs/outputFile.md
index 494cba3..51fa00f 100644
--- a/docs/outputFile.md
+++ b/docs/outputFile.md
@@ -1,11 +1,8 @@
 # outputFile(file, data, [options], callback)
 
-Almost the same as `writeFile` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `file` must be a file path (a buffer or a file descriptor is not allowed). `options` are what you'd pass to [`fs.writeFile()`](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback).
+Almost the same as `writeFile` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `options` are what you'd pass to [`fs.writeFile()`](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback).
 
-- `file` `<String>`
-- `data` `<String> | <Buffer> | <Uint8Array>`
-- `options` `<Object> | <String>`
-- `callback` `<Function>`
+**Sync:** `outputFileSync()`
 
 ## Example:
 
diff --git a/docs/outputJson-sync.md b/docs/outputJson-sync.md
deleted file mode 100644
index cab6316..0000000
--- a/docs/outputJson-sync.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# outputJsonSync(file, object, [options])
-
-Almost the same as [`writeJsonSync`](writeJson-sync.md), except that if the directory does not exist, it's created.
-`options` are what you'd pass to [`jsonFile.writeFileSync()`](https://github.com/jprichardson/node-jsonfile#writefilesyncfilename-obj-options).
-
-**Alias:** `outputJSONSync()`
-
-- `file` `<String>`
-- `object` `<Object>`
-- `options` `<Object>`
-
-## Example:
-
-```js
-const fs = require('fs-extra')
-
-const file = '/tmp/this/path/does/not/exist/file.json'
-fs.outputJsonSync(file, {name: 'JP'})
-
-const data = fs.readJsonSync(file)
-console.log(data.name) // => JP
-```
diff --git a/docs/outputJson.md b/docs/outputJson.md
index 58917b8..0d41902 100644
--- a/docs/outputJson.md
+++ b/docs/outputJson.md
@@ -1,21 +1,18 @@
-# outputJson(file, object, [options], callback)
+# outputJson(file, data, [options], callback)
 
 Almost the same as [`writeJson`](writeJson.md), except that if the directory does not exist, it's created.
 `options` are what you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback).
 
 **Alias:** `outputJSON()`
 
-- `file` `<String>`
-- `object` `<Object>`
-- `options` `<Object>`
-- `callback` `<Function>`
+**Sync:** `outputJsonSync()`, `outputJSONSync()`
 
 ## Example:
 
 ```js
 const fs = require('fs-extra')
 
-const file = '/tmp/this/path/does/not/exist/file.json'
+const file = '/tmp/this/path/does/not/exist/file.txt'
 fs.outputJson(file, {name: 'JP'}, err => {
   console.log(err) // => null
 
diff --git a/docs/readJson-sync.md b/docs/readJson-sync.md
deleted file mode 100644
index a135637..0000000
--- a/docs/readJson-sync.md
+++ /dev/null
@@ -1,33 +0,0 @@
-# readJsonSync(file, [options])
-
-Reads a JSON file and then parses it into an object. `options` are the same
-that you'd pass to [`jsonFile.readFileSync`](https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options).
-
-**Alias:** `readJSONSync()`
-
-- `file` `<String>`
-- `options` `<Object>`
-
-## Example:
-
-```js
-const fs = require('fs-extra')
-
-const packageObj = fs.readJsonSync('./package.json')
-console.log(packageObj.version) // => 2.0.0
-```
-
----
-
-`readJsonSync()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example:
-
-```js
-const fs = require('fs-extra')
-
-const file = '/tmp/some-invalid.json'
-const data = '{not valid JSON'
-fs.writeFileSync(file, data)
-
-const obj = fs.readJsonSync(file, { throws: false })
-console.log(obj) // => null
-```
diff --git a/docs/readJson.md b/docs/readJson.md
index acaf19c..25a0f97 100644
--- a/docs/readJson.md
+++ b/docs/readJson.md
@@ -5,9 +5,7 @@ that you'd pass to [`jsonFile.readFile`](https://github.com/jprichardson/node-js
 
 **Alias:** `readJSON()`
 
-- `file` `<String>`
-- `options` `<Object>`
-- `callback` `<Function>`
+**Sync:** `readJsonSync()`, `readJSONSync()`
 
 ## Example:
 
@@ -15,26 +13,20 @@ that you'd pass to [`jsonFile.readFile`](https://github.com/jprichardson/node-js
 const fs = require('fs-extra')
 
 fs.readJson('./package.json', (err, packageObj) => {
-  if (err) console.error(err)
-  
   console.log(packageObj.version) // => 0.1.3
 })
 ```
 
 ---
 
-`readJson()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example:
+`readJsonSync()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example:
 
 ```js
 const fs = require('fs-extra')
-
-const file = '/tmp/some-invalid.json'
+const file = path.join('/tmp/some-invalid.json')
 const data = '{not valid JSON'
 fs.writeFileSync(file, data)
 
-fs.readJson(file, { throws: false }, (err, obj) => {
-  if (err) console.error(err)
-
-  console.log(obj) // => null
-})
+const obj = fs.readJsonSync(file, {throws: false})
+console.log(obj) // => null
 ```
diff --git a/docs/remove-sync.md b/docs/remove-sync.md
deleted file mode 100644
index fb01fe8..0000000
--- a/docs/remove-sync.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# removeSync(path)
-
-Removes a file or directory. The directory can have contents. Like `rm -rf`.
-
-- `path` `<String>`
-
-## Example:
-
-```js
-const fs = require('fs-extra')
-
-// remove file
-fs.removeSync('/tmp/myfile')
-
-fs.removeSync('/home/jprichardson') // I just deleted my entire HOME directory.
-```
diff --git a/docs/remove.md b/docs/remove.md
index 68f9162..c96c47b 100644
--- a/docs/remove.md
+++ b/docs/remove.md
@@ -1,25 +1,19 @@
-# remove(path, callback)
+# remove(dir, callback)
 
 Removes a file or directory. The directory can have contents. Like `rm -rf`.
 
-- `path` `<String>`
-- `callback` `<Function>`
+**Sync:** `removeSync()`
 
 ## Example:
 
 ```js
 const fs = require('fs-extra')
 
-// remove file
 fs.remove('/tmp/myfile', err => {
   if (err) return console.error(err)
 
   console.log('success!')
 })
 
-fs.remove('/home/jprichardson', err => {
-  if (err) return console.error(err)
-
-  console.log('success!') // I just deleted my entire HOME directory.
-})
+fs.removeSync('/home/jprichardson') // I just deleted my entire HOME directory.
 ```
diff --git a/docs/writeJson-sync.md b/docs/writeJson-sync.md
deleted file mode 100644
index 9e649bb..0000000
--- a/docs/writeJson-sync.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# writeJsonSync(file, object, [options])
-
-Writes an object to a JSON file. `options` are the same that
-you'd pass to [`jsonFile.writeFileSync()`](https://github.com/jprichardson/node-jsonfile#writefilesyncfilename-obj-options).
-
-**Alias:** `writeJSONSync()`
-
-- `file` `<String>`
-- `object` `<Object>`
-- `options` `<Object>`
-
-## Example:
-
-```js
-const fs = require('fs-extra')
-
-fs.writeJsonSync('./package.json', {name: 'fs-extra'})
-```
----
-
-**See also:** [`outputJsonSync()`](outputJson-sync.md)
diff --git a/docs/writeJson.md b/docs/writeJson.md
index 3f8f042..8f00106 100644
--- a/docs/writeJson.md
+++ b/docs/writeJson.md
@@ -5,10 +5,7 @@ you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-json
 
 **Alias:** `writeJSON()`
 
-- `file` `<String>`
-- `object` `<Object>`
-- `options` `<Object>`
-- `callback` `<Function>`
+**Sync:** `writeJsonSync()`, `writeJSONSync()`
 
 ## Example:
 
diff --git a/lib/copy-sync/copy-file-sync.js b/lib/copy-sync/copy-file-sync.js
index c6386d5..4e4cd3f 100644
--- a/lib/copy-sync/copy-file-sync.js
+++ b/lib/copy-sync/copy-file-sync.js
@@ -3,7 +3,7 @@
 const fs = require('graceful-fs')
 
 const BUF_LENGTH = 64 * 1024
-const _buff = Buffer.alloc(BUF_LENGTH)
+const _buff = new Buffer(BUF_LENGTH)
 
 function copyFileSync (srcFile, destFile, options) {
   const overwrite = options.overwrite
diff --git a/lib/index.js b/lib/index.js
index d25fd54..e840a9d 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -18,7 +18,6 @@ assign(fs, require('./mkdirs'))
 assign(fs, require('./remove'))
 assign(fs, require('./json'))
 assign(fs, require('./move'))
-assign(fs, require('./move-sync'))
 assign(fs, require('./empty'))
 assign(fs, require('./ensure'))
 assign(fs, require('./output'))
diff --git a/lib/move-sync/index.js b/lib/move-sync/index.js
deleted file mode 100644
index 435fbe1..0000000
--- a/lib/move-sync/index.js
+++ /dev/null
@@ -1,117 +0,0 @@
-'use strict'
-
-const fs = require('graceful-fs')
-const path = require('path')
-const copySync = require('../copy-sync').copySync
-const removeSync = require('../remove').removeSync
-const mkdirpSync = require('../mkdirs').mkdirsSync
-
-function moveSync (src, dest, options) {
-  options = options || {}
-  const overwrite = options.overwrite || options.clobber || false
-
-  src = path.resolve(src)
-  dest = path.resolve(dest)
-
-  if (src === dest) return
-
-  if (isSrcSubdir(src, dest)) throw new Error(`Cannot move '${src}' into itself '${dest}'.`)
-
-  mkdirpSync(path.dirname(dest))
-  tryRenameSync()
-
-  function tryRenameSync () {
-    if (overwrite) {
-      try {
-        return fs.renameSync(src, dest)
-      } catch (err) {
-        if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST' || err.code === 'EPERM') {
-          removeSync(dest)
-          options.overwrite = false // just overwriteed it, no need to do it again
-          return moveSync(src, dest, options)
-        }
-
-        if (err.code !== 'EXDEV') throw err
-        return moveSyncAcrossDevice(src, dest, overwrite)
-      }
-    } else {
-      try {
-        fs.linkSync(src, dest)
-        return fs.unlinkSync(src)
-      } catch (err) {
-        if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') {
-          return moveSyncAcrossDevice(src, dest, overwrite)
-        }
-        throw err
-      }
-    }
-  }
-}
-
-function moveSyncAcrossDevice (src, dest, overwrite) {
-  const stat = fs.statSync(src)
-
-  if (stat.isDirectory()) {
-    return moveDirSyncAcrossDevice(src, dest, overwrite)
-  } else {
-    return moveFileSyncAcrossDevice(src, dest, overwrite)
-  }
-}
-
-function moveFileSyncAcrossDevice (src, dest, overwrite) {
-  const BUF_LENGTH = 64 * 1024
-  const _buff = Buffer.alloc(BUF_LENGTH)
-
-  const flags = overwrite ? 'w' : 'wx'
-
-  const fdr = fs.openSync(src, 'r')
-  const stat = fs.fstatSync(fdr)
-  const fdw = fs.openSync(dest, flags, stat.mode)
-  let bytesRead = 1
-  let pos = 0
-
-  while (bytesRead > 0) {
-    bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos)
-    fs.writeSync(fdw, _buff, 0, bytesRead)
-    pos += bytesRead
-  }
-
-  fs.closeSync(fdr)
-  fs.closeSync(fdw)
-  return fs.unlinkSync(src)
-}
-
-function moveDirSyncAcrossDevice (src, dest, overwrite) {
-  const options = {
-    overwrite: false
-  }
-
-  if (overwrite) {
-    removeSync(dest)
-    tryCopySync()
-  } else {
-    tryCopySync()
-  }
-
-  function tryCopySync () {
-    copySync(src, dest, options)
-    return removeSync(src)
-  }
-}
-
-// return true if dest is a subdir of src, otherwise false.
-// extract dest base dir and check if that is the same as src basename
-function isSrcSubdir (src, dest) {
-  try {
-    return fs.statSync(src).isDirectory() &&
-           src !== dest &&
-           dest.indexOf(src) > -1 &&
-           dest.split(path.dirname(src) + path.sep)[1].split(path.sep)[0] === path.basename(src)
-  } catch (e) {
-    return false
-  }
-}
-
-module.exports = {
-  moveSync
-}
diff --git a/lib/move/index.js b/lib/move/index.js
index 195ab9f..6bbdaf4 100644
--- a/lib/move/index.js
+++ b/lib/move/index.js
@@ -35,7 +35,9 @@ function move (source, dest, options, callback) {
   }
 
   function doRename () {
-    if (overwrite) {
+    if (path.resolve(source) === path.resolve(dest)) {
+      setImmediate(callback)
+    } else if (overwrite) {
       fs.rename(source, dest, err => {
         if (!err) return callback()
 
diff --git a/package.json b/package.json
index bdd2d41..6dae7ba 100644
--- a/package.json
+++ b/package.json
@@ -40,7 +40,6 @@
     "coveralls": "^2.11.2",
     "istanbul": "^0.4.5",
     "klaw": "^1.0.0",
-    "klaw-sync": "^1.1.2",
     "minimist": "^1.1.1",
     "mocha": "^3.1.2",
     "proxyquire": "^1.7.10",
@@ -57,8 +56,5 @@
     "test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha",
     "test": "npm run lint && npm run unit",
     "unit": "node test.js"
-  },
-  "engines": {
-    "node": ">=4.5.0"
   }
 }


Test patch:
diff --git a/lib/move-sync/__tests__/move-sync-prevent-moving-into-itself.test.js b/lib/move-sync/__tests__/move-sync-prevent-moving-into-itself.test.js
deleted file mode 100644
index 3685faa..0000000
--- a/lib/move-sync/__tests__/move-sync-prevent-moving-into-itself.test.js
+++ /dev/null
@@ -1,189 +0,0 @@
-'use strict'
-
-const assert = require('assert')
-const os = require('os')
-const path = require('path')
-const fs = require(process.cwd())
-const klawSync = require('klaw-sync')
-
-/* global beforeEach, afterEach, describe, it */
-
-const FILES = [
-  'file0.txt',
-  path.join('dir1', 'file1.txt'),
-  path.join('dir1', 'dir2', 'file2.txt'),
-  path.join('dir1', 'dir2', 'dir3', 'file3.txt')
-]
-
-const dat0 = 'file0'
-const dat1 = 'file1'
-const dat2 = 'file2'
-const dat3 = 'file3'
-
-describe('+ moveSync() - prevent moving into itself', () => {
-  let TEST_DIR, src, dest
-
-  beforeEach(() => {
-    TEST_DIR = path.join(os.tmpdir(), 'fs-extra', 'move-sync-prevent-moving-into-itself')
-    src = path.join(TEST_DIR, 'src')
-    fs.mkdirsSync(src)
-
-    fs.outputFileSync(path.join(src, FILES[0]), dat0)
-    fs.outputFileSync(path.join(src, FILES[1]), dat1)
-    fs.outputFileSync(path.join(src, FILES[2]), dat2)
-    fs.outputFileSync(path.join(src, FILES[3]), dat3)
-  })
-
-  afterEach(() => fs.removeSync(TEST_DIR))
-
-  describe('> when source is a file', () => {
-    it(`should move the file successfully even when dest parent is 'src/dest'`, () => {
-      const destFile = path.join(TEST_DIR, 'src', 'dest', 'destfile.txt')
-      return testSuccessFile(src, destFile)
-    })
-
-    it(`should move the file successfully when dest parent is 'src/src_dest'`, () => {
-      const destFile = path.join(TEST_DIR, 'src', 'src_dest', 'destfile.txt')
-      return testSuccessFile(src, destFile)
-    })
-
-    it(`should move the file successfully when dest parent is 'src/dest_src'`, () => {
-      const destFile = path.join(TEST_DIR, 'src', 'dest_src', 'destfile.txt')
-      return testSuccessFile(src, destFile)
-    })
-
-    it(`should move the file successfully when dest parent is 'src/dest/src'`, () => {
-      const destFile = path.join(TEST_DIR, 'src', 'dest', 'src', 'destfile.txt')
-      return testSuccessFile(src, destFile)
-    })
-
-    it(`should move the file successfully when dest parent is 'srcsrc/dest'`, () => {
-      const destFile = path.join(TEST_DIR, 'srcsrc', 'dest', 'destfile.txt')
-      return testSuccessFile(src, destFile)
-    })
-  })
-
-  describe('> when source is a directory', () => {
-    it(`should move the directory successfully when dest is 'src_dest'`, () => {
-      dest = path.join(TEST_DIR, 'src_dest')
-      return testSuccessDir(src, dest)
-    })
-
-    it(`should move the directory successfully when dest is 'src-dest'`, () => {
-      dest = path.join(TEST_DIR, 'src-dest')
-      return testSuccessDir(src, dest)
-    })
-
-    it(`should move the directory successfully when dest is 'dest_src'`, () => {
-      dest = path.join(TEST_DIR, 'dest_src')
-      return testSuccessDir(src, dest)
-    })
-
-    it(`should move the directory successfully when dest is 'src_dest/src'`, () => {
-      dest = path.join(TEST_DIR, 'src_dest', 'src')
-      return testSuccessDir(src, dest)
-    })
-
-    it(`should move the directory successfully when dest is 'src-dest/src'`, () => {
-      dest = path.join(TEST_DIR, 'src-dest', 'src')
-      return testSuccessDir(src, dest)
-    })
-
-    it(`should move the directory successfully when dest is 'dest_src/src'`, () => {
-      dest = path.join(TEST_DIR, 'dest_src', 'src')
-      return testSuccessDir(src, dest)
-    })
-
-    it(`should move the directory successfully when dest is 'src_src/dest'`, () => {
-      dest = path.join(TEST_DIR, 'src_src', 'dest')
-      return testSuccessDir(src, dest)
-    })
-
-    it(`should move the directory successfully when dest is 'src-src/dest'`, () => {
-      dest = path.join(TEST_DIR, 'src-src', 'dest')
-      return testSuccessDir(src, dest)
-    })
-
-    it(`should move the directory successfully when dest is 'srcsrc/dest'`, () => {
-      dest = path.join(TEST_DIR, 'srcsrc', 'dest')
-      return testSuccessDir(src, dest)
-    })
-
-    it(`should move the directory successfully when dest is 'dest/src'`, () => {
-      dest = path.join(TEST_DIR, 'dest', 'src')
-      return testSuccessDir(src, dest)
-    })
-
-    it('should move the directory successfully when dest is very nested that all its parents need to be created', () => {
-      dest = path.join(TEST_DIR, 'dest', 'src', 'foo', 'bar', 'baz', 'qux', 'quux', 'waldo',
-        'grault', 'garply', 'fred', 'plugh', 'thud', 'some', 'highly', 'deeply',
-        'badly', 'nasty', 'crazy', 'mad', 'nested', 'dest')
-      assert(!fs.existsSync(dest))
-      return testSuccessDir(src, dest)
-    })
-
-    it(`should throw error when dest is 'src/dest'`, () => {
-      dest = path.join(TEST_DIR, 'src', 'dest')
-      return testError(src, dest)
-    })
-
-    it(`should throw error when dest is 'src/src_dest'`, () => {
-      dest = path.join(TEST_DIR, 'src', 'src_dest')
-      return testError(src, dest)
-    })
-
-    it(`should throw error when dest is 'src/dest_src'`, () => {
-      dest = path.join(TEST_DIR, 'src', 'dest_src')
-      return testError(src, dest)
-    })
-
-    it(`should throw error when dest is 'src/dest/src'`, () => {
-      dest = path.join(TEST_DIR, 'src', 'dest', 'src')
-      return testError(src, dest)
-    })
-  })
-})
-
-function testSuccessFile (src, destFile) {
-  const srcFile = path.join(src, FILES[0])
-
-  fs.moveSync(srcFile, destFile)
-
-  const o0 = fs.readFileSync(destFile, 'utf8')
-  assert.strictEqual(o0, dat0, 'file contents matched')
-  assert(!fs.existsSync(srcFile))
-}
-
-function testSuccessDir (src, dest) {
-  const srclen = klawSync(src).length
-  // assert src has contents
-  assert(srclen > 2)
-
-  fs.moveSync(src, dest)
-
-  const destlen = klawSync(dest).length
-
-  // assert src and dest length are the same
-  assert.strictEqual(destlen, srclen, 'src and dest length should be equal')
-
-  const o0 = fs.readFileSync(path.join(dest, FILES[0]), 'utf8')
-  const o1 = fs.readFileSync(path.join(dest, FILES[1]), 'utf8')
-  const o2 = fs.readFileSync(path.join(dest, FILES[2]), 'utf8')
-  const o3 = fs.readFileSync(path.join(dest, FILES[3]), 'utf8')
-
-  assert.strictEqual(o0, dat0, 'file contents matched')
-  assert.strictEqual(o1, dat1, 'file contents matched')
-  assert.strictEqual(o2, dat2, 'file contents matched')
-  assert.strictEqual(o3, dat3, 'file contents matched')
-  assert(!fs.existsSync(src))
-}
-
-function testError (src, dest) {
-  try {
-    fs.moveSync(src, dest)
-  } catch (err) {
-    assert.strictEqual(err.message, `Cannot move '${src}' into itself '${dest}'.`)
-    assert(fs.existsSync(src))
-    assert(!fs.existsSync(dest))
-  }
-}
diff --git a/lib/move-sync/__tests__/move-sync.test.js b/lib/move-sync/__tests__/move-sync.test.js
deleted file mode 100644
index 58361a9..0000000
--- a/lib/move-sync/__tests__/move-sync.test.js
+++ /dev/null
@@ -1,352 +0,0 @@
-'use strict'
-
-const fs = require('graceful-fs')
-const os = require('os')
-const fse = require(process.cwd())
-const path = require('path')
-const assert = require('assert')
-const rimraf = require('rimraf')
-
-/* global afterEach, beforeEach, describe, it */
-
-function createSyncErrFn (errCode) {
-  const fn = function () {
-    const err = new Error()
-    err.code = errCode
-    throw err
-  }
-  return fn
-}
-
-const originalRenameSync = fs.renameSync
-const originalLinkSync = fs.linkSync
-
-function setUpMockFs (errCode) {
-  fs.renameSync = createSyncErrFn(errCode)
-  fs.linkSync = createSyncErrFn(errCode)
-}
-
-function tearDownMockFs () {
-  fs.renameSync = originalRenameSync
-  fs.linkSync = originalLinkSync
-}
-
-describe('moveSync()', () => {
-  let TEST_DIR
-
-  beforeEach(() => {
-    TEST_DIR = path.join(os.tmpdir(), 'fs-extra', 'move-sync')
-
-    fse.emptyDirSync(TEST_DIR)
-
-    // Create fixtures:
-    fs.writeFileSync(path.join(TEST_DIR, 'a-file'), 'sonic the hedgehog\n')
-    fs.mkdirSync(path.join(TEST_DIR, 'a-folder'))
-    fs.writeFileSync(path.join(TEST_DIR, 'a-folder/another-file'), 'tails\n')
-    fs.mkdirSync(path.join(TEST_DIR, 'a-folder/another-folder'))
-    fs.writeFileSync(path.join(TEST_DIR, 'a-folder/another-folder/file3'), 'knuckles\n')
-  })
-
-  afterEach(done => rimraf(TEST_DIR, done))
-
-  it('should not move if src and dest are the same', () => {
-    const src = `${TEST_DIR}/a-file`
-    const dest = `${TEST_DIR}/a-file`
-
-    fse.moveSync(src, dest)
-
-    // assert src not affected
-    const contents = fs.readFileSync(src, 'utf8')
-    const expected = /^sonic the hedgehog\r?\n$/
-    assert.ok(contents.match(expected), `${contents} match ${expected}`)
-  })
-
-  it('should rename a file on the same device', () => {
-    const src = `${TEST_DIR}/a-file`
-    const dest = `${TEST_DIR}/a-file-dest`
-
-    fse.moveSync(src, dest)
-
-    const contents = fs.readFileSync(dest, 'utf8')
-    const expected = /^sonic the hedgehog\r?\n$/
-    assert.ok(contents.match(expected), `${contents} match ${expected}`)
-  })
-
-  it('should not overwrite the destination by default', () => {
-    const src = `${TEST_DIR}/a-file`
-    const dest = `${TEST_DIR}/a-folder/another-file`
-
-    // verify file exists already
-    assert(fs.existsSync(dest))
-
-    try {
-      fse.moveSync(src, dest)
-    } catch (err) {
-      assert.ok(err && err.code === 'EEXIST', 'throw EEXIST')
-    }
-  })
-
-  it('should not overwrite if overwrite = false', () => {
-    const src = `${TEST_DIR}/a-file`
-    const dest = `${TEST_DIR}/a-folder/another-file`
-
-    // verify file exists already
-    assert(fs.existsSync(dest))
-
-    try {
-      fse.moveSync(src, dest, {overwrite: false})
-    } catch (err) {
-      assert.ok(err && err.code === 'EEXIST', 'throw EEXIST')
-    }
-  })
-
-  it('should overwrite file if overwrite = true', () => {
-    const src = `${TEST_DIR}/a-file`
-    const dest = `${TEST_DIR}/a-folder/another-file`
-
-    // verify file exists already
-    assert(fs.existsSync(dest))
-
-    fse.moveSync(src, dest, {overwrite: true})
-
-    const contents = fs.readFileSync(dest, 'utf8')
-    const expected = /^sonic the hedgehog\r?\n$/
-    assert.ok(contents.match(expected), `${contents} match ${expected}`)
-  })
-
-  it('should overwrite the destination directory if overwrite = true', function (done) {
-    // Tests fail on appveyor/Windows due to
-    // https://github.com/isaacs/node-graceful-fs/issues/98.
-    // Workaround by increasing the timeout by a minute (because
-    // graceful times out after a minute).
-    this.timeout(90000)
-
-    // Create src
-    const src = path.join(TEST_DIR, 'src')
-    fse.ensureDirSync(src)
-    fse.mkdirsSync(path.join(src, 'some-folder'))
-    fs.writeFileSync(path.join(src, 'some-file'), 'hi')
-
-    const dest = path.join(TEST_DIR, 'a-folder')
-
-    // verify dest has stuff in it
-    const pathsBefore = fs.readdirSync(dest)
-    assert(pathsBefore.indexOf('another-file') >= 0)
-    assert(pathsBefore.indexOf('another-folder') >= 0)
-
-    fse.moveSync(src, dest, {overwrite: true})
-
-    // verify dest does not have old stuff
-    const pathsAfter = fs.readdirSync(dest)
-    assert.strictEqual(pathsAfter.indexOf('another-file'), -1)
-    assert.strictEqual(pathsAfter.indexOf('another-folder'), -1)
-
-    // verify dest has new stuff
-    assert(pathsAfter.indexOf('some-file') >= 0)
-    assert(pathsAfter.indexOf('some-folder') >= 0)
-    done()
-  })
-
-  it('should create directory structure by default', () => {
-    const src = `${TEST_DIR}/a-file`
-    const dest = `${TEST_DIR}/does/not/exist/a-file-dest`
-
-    // verify dest directory does not exist
-    assert(!fs.existsSync(path.dirname(dest)))
-
-    fse.moveSync(src, dest)
-
-    const contents = fs.readFileSync(dest, 'utf8')
-    const expected = /^sonic the hedgehog\r?\n$/
-    assert.ok(contents.match(expected), `${contents} match ${expected}`)
-  })
-
-  it('should work across devices', () => {
-    const src = `${TEST_DIR}/a-file`
-    const dest = `${TEST_DIR}/a-file-dest`
-
-    setUpMockFs('EXDEV')
-
-    fse.moveSync(src, dest)
-
-    const contents = fs.readFileSync(dest, 'utf8')
-    const expected = /^sonic the hedgehog\r?\n$/
-    assert.ok(contents.match(expected), `${contents} match ${expected}`)
-    tearDownMockFs()
-  })
-
-  it('should move folders', () => {
-    const src = `${TEST_DIR}/a-folder`
-    const dest = `${TEST_DIR}/a-folder-dest`
-
-    // verify it doesn't exist
-    assert(!fs.existsSync(dest))
-
-    fse.moveSync(src, dest)
-
-    const contents = fs.readFileSync(dest + '/another-file', 'utf8')
-    const expected = /^tails\r?\n$/
-    assert.ok(contents.match(expected), `${contents} match ${expected}`)
-  })
-
-  it('should move folders across devices with EISDIR error', () => {
-    const src = `${TEST_DIR}/a-folder`
-    const dest = `${TEST_DIR}/a-folder-dest`
-
-    setUpMockFs('EISDIR')
-
-    fse.moveSync(src, dest)
-
-    const contents = fs.readFileSync(dest + '/another-folder/file3', 'utf8')
-    const expected = /^knuckles\r?\n$/
-    assert.ok(contents.match(expected), `${contents} match ${expected}`)
-    tearDownMockFs()
-  })
-
-  it('should overwrite folders across devices', () => {
-    const src = `${TEST_DIR}/a-folder`
-    const dest = `${TEST_DIR}/a-folder-dest`
-
-    fs.mkdirSync(dest)
-
-    setUpMockFs('EXDEV')
-
-    fse.moveSync(src, dest, {overwrite: true})
-
-    const contents = fs.readFileSync(dest + '/another-folder/file3', 'utf8')
-    const expected = /^knuckles\r?\n$/
-    assert.ok(contents.match(expected), `${contents} match ${expected}`)
-    tearDownMockFs()
-  })
-
-  it('should move folders across devices with EXDEV error', () => {
-    const src = `${TEST_DIR}/a-folder`
-    const dest = `${TEST_DIR}/a-folder-dest`
-
-    setUpMockFs('EXDEV')
-
-    fse.moveSync(src, dest)
-
-    const contents = fs.readFileSync(dest + '/another-folder/file3', 'utf8')
-    const expected = /^knuckles\r?\n$/
-    assert.ok(contents.match(expected), `${contents} match ${expected}`)
-    tearDownMockFs()
-  })
-
-  it('should move folders across devices with EPERM error', () => {
-    const src = `${TEST_DIR}/a-folder`
-    const dest = `${TEST_DIR}/a-folder-dest`
-
-    setUpMockFs('EPERM')
-
-    fse.moveSync(src, dest)
-
-    const contents = fs.readFileSync(dest + '/another-folder/file3', 'utf8')
-    const expected = /^knuckles\r?\n$/
-    assert.ok(contents.match(expected), `${contents} match ${expected}`)
-    tearDownMockFs()
-  })
-
-  it('should move folders across devices with ENOTSUP error', () => {
-    const src = `${TEST_DIR}/a-folder`
-    const dest = `${TEST_DIR}/a-folder-dest`
-
-    setUpMockFs('ENOTSUP')
-
-    fse.moveSync(src, dest)
-
-    const contents = fs.readFileSync(dest + '/another-folder/file3', 'utf8')
-    const expected = /^knuckles\r?\n$/
-    assert.ok(contents.match(expected), `${contents} match ${expected}`)
-    tearDownMockFs()
-  })
-
-  describe('clobber', () => {
-    it('should be an alias for overwrite', () => {
-      const src = `${TEST_DIR}/a-file`
-      const dest = `${TEST_DIR}/a-folder/another-file`
-
-      // verify file exists already
-      assert(fs.existsSync(dest))
-
-      fse.moveSync(src, dest, {clobber: true})
-
-      const contents = fs.readFileSync(dest, 'utf8')
-      const expected = /^sonic the hedgehog\r?\n$/
-      assert.ok(contents.match(expected), `${contents} match ${expected}`)
-    })
-  })
-
-  describe('> when trying to move a folder into itself', () => {
-    it('should produce an error', () => {
-      const SRC_DIR = path.join(TEST_DIR, 'src')
-      const DEST_DIR = path.join(TEST_DIR, 'src', 'dest')
-
-      assert(!fs.existsSync(SRC_DIR))
-      fs.mkdirSync(SRC_DIR)
-      assert(fs.existsSync(SRC_DIR))
-
-      try {
-        fse.moveSync(SRC_DIR, DEST_DIR)
-      } catch (err) {
-        assert(err.message, `Cannot move ${SRC_DIR} into itself ${DEST_DIR}.`)
-        assert(fs.existsSync(SRC_DIR))
-        assert(!fs.existsSync(DEST_DIR))
-      }
-    })
-  })
-
-  describe('> when trying to move a file into its parent subdirectory', () => {
-    it('should move successfully', () => {
-      const src = `${TEST_DIR}/a-file`
-      const dest = `${TEST_DIR}/dest/a-file-dest`
-
-      fse.moveSync(src, dest)
-
-      const contents = fs.readFileSync(dest, 'utf8')
-      const expected = /^sonic the hedgehog\r?\n$/
-      assert.ok(contents.match(expected), `${contents} match ${expected}`)
-    })
-  })
-
-  describe('> when actually trying to move a folder across devices', () => {
-    const differentDevice = '/mnt'
-    let __skipTests = false
-
-    // must set this up, if not, exit silently
-    if (!fs.existsSync(differentDevice)) {
-      console.log('Skipping cross-device moveSync test')
-      __skipTests = true
-    }
-
-    // make sure we have permission on device
-    try {
-      fs.writeFileSync(path.join(differentDevice, 'file'), 'hi')
-    } catch (err) {
-      console.log("Can't write to device. Skipping moveSync test.")
-      __skipTests = true
-    }
-
-    const _it = __skipTests ? it.skip : it
-
-    describe('> just the folder', () => {
-      _it('should move the folder', () => {
-        const src = '/mnt/some/weird/dir-really-weird'
-        const dest = path.join(TEST_DIR, 'device-weird')
-
-        if (!fs.existsSync(src)) {
-          fse.mkdirpSync(src)
-        }
-
-        assert(!fs.existsSync(dest))
-
-        assert(fs.lstatSync(src).isDirectory())
-
-        fse.moveSync(src, dest)
-
-        assert(fs.existsSync(dest))
-        assert(fs.lstatSync(dest).isDirectory())
-      })
-    })
-  })
-})
diff --git a/lib/move/__tests__/move.test.js b/lib/move/__tests__/move.test.js
index 9045b7e..efd94f9 100644
--- a/lib/move/__tests__/move.test.js
+++ b/lib/move/__tests__/move.test.js
@@ -69,6 +69,26 @@ describe('move', () => {
     })
   })
 
+  it('should not move a file if source and destination are the same', done => {
+    const src = `${TEST_DIR}/a-file`
+    const dest = src
+
+    fse.move(src, dest, err => {
+      assert.ifError(err)
+      done()
+    })
+  })
+
+  it('should not move a directory if source and destination are the same', done => {
+    const src = `${TEST_DIR}/a-folder`
+    const dest = src
+
+    fse.move(src, dest, err => {
+      assert.ifError(err)
+      done()
+    })
+  })
+
   it('should not overwrite the destination by default', done => {
     const src = `${TEST_DIR}/a-file`
     const dest = `${TEST_DIR}/a-folder/another-file`
@@ -295,7 +315,7 @@ describe('move', () => {
       // verify file exists already
       assert(fs.existsSync(dest))
 
-      fse.move(src, dest, {clobber: true}, err => {
+      fse.move(src, dest, {overwrite: true}, err => {
         assert.ifError(err)
         fs.readFile(dest, 'utf8', (err, contents) => {
           const expected = /^sonic the hedgehog\r?\n$/
@@ -307,7 +327,7 @@ describe('move', () => {
     })
   })
 
-  describe.skip('> when trying to move a folder into itself', () => {
+  describe.skip('> when trying to a move a folder into itself', () => {
     it('should produce an error', done => {
       const SRC_DIR = path.join(TEST_DIR, 'test')
       const DEST_DIR = path.join(TEST_DIR, 'test', 'test')
@@ -327,7 +347,7 @@ describe('move', () => {
   // tested on Linux ubuntu 3.13.0-32-generic #57-Ubuntu SMP i686 i686 GNU/Linux
   // this won't trigger a bug on Mac OS X Yosimite with a USB drive (/Volumes)
   // see issue #108
-  describe('> when actually trying to move a folder across devices', () => {
+  describe('> when actually trying to a move a folder across devices', () => {
     const differentDevice = '/mnt'
     let __skipTests = false
 
@@ -341,7 +361,7 @@ describe('move', () => {
     try {
       fs.writeFileSync(path.join(differentDevice, 'file'), 'hi')
     } catch (err) {
-      console.log("Can't write to device. Skipping move test.")
+      console.log("Can't write to device. Skipping test.")
       __skipTests = true
     }