diff --git a/docs/copy-sync.md b/docs/copy-sync.md index b6de1a3..8e61c2b 100644 --- a/docs/copy-sync.md +++ b/docs/copy-sync.md @@ -2,12 +2,14 @@ Copy a file or directory. The directory can have contents. Like `cp -r`. -## 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). +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: 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` ``: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`. + - `dereference` ``: dereference symlinks, default is `false`. + - `preserveTimestamps` ``: 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/copy.md b/docs/copy.md index ce5c413..a4f75e9 100644 --- a/docs/copy.md +++ b/docs/copy.md @@ -2,12 +2,15 @@ Copy a file or directory. The directory can have contents. Like `cp -r`. -## 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). +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: 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` ``: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`. + - `dereference` ``: dereference symlinks, default is `false`. + - `preserveTimestamps` ``: 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). +- `callback` `` ## Example: diff --git a/docs/emptyDir-sync.md b/docs/emptyDir-sync.md index 603c279..7decdbc 100644 --- a/docs/emptyDir-sync.md +++ b/docs/emptyDir-sync.md @@ -4,6 +4,8 @@ Ensures that a directory is empty. Deletes directory contents if the directory i **Alias:** `emptydirSync()` +- `dir` `` + ## Example: ```js diff --git a/docs/emptyDir.md b/docs/emptyDir.md index a5263fb..43292e3 100644 --- a/docs/emptyDir.md +++ b/docs/emptyDir.md @@ -4,6 +4,9 @@ Ensures that a directory is empty. Deletes directory contents if the directory i **Alias:** `emptydir()` +- `dir` `` +- `callback` `` + ## Example: ```js diff --git a/docs/ensureDir-sync.md b/docs/ensureDir-sync.md index 4d3e39f..8f083d2 100644 --- a/docs/ensureDir-sync.md +++ b/docs/ensureDir-sync.md @@ -4,6 +4,8 @@ Ensures that the directory exists. If the directory structure does not exist, it **Aliases:** `mkdirsSync()`, `mkdirpSync()` +- `dir` `` + ## Example: ```js diff --git a/docs/ensureDir.md b/docs/ensureDir.md index 9a3015c..1f8acfb 100644 --- a/docs/ensureDir.md +++ b/docs/ensureDir.md @@ -4,7 +4,8 @@ Ensures that the directory exists. If the directory structure does not exist, it **Aliases:** `mkdirs()`, `mkdirp()` -**Sync:** `ensureDirSync()`, `mkdirsSync()`, `mkdirpSync()` +- `dir` `` +- `callback` `` ## Example: diff --git a/docs/ensureFile-sync.md b/docs/ensureFile-sync.md index b9f9685..25ac39d 100644 --- a/docs/ensureFile-sync.md +++ b/docs/ensureFile-sync.md @@ -4,6 +4,8 @@ Ensures that the file exists. If the file that is requested to be created is in **Alias:** `createFileSync()` +- `file` `` + ## Example: ```js diff --git a/docs/ensureFile.md b/docs/ensureFile.md index 4ec975f..1567e60 100644 --- a/docs/ensureFile.md +++ b/docs/ensureFile.md @@ -4,6 +4,9 @@ Ensures that the file exists. If the file that is requested to be created is in **Alias:** `createFile()` +- `file` `` +- `callback` `` + ## Example: ```js diff --git a/docs/ensureLink-sync.md b/docs/ensureLink-sync.md index 7620d3c..74769d3 100644 --- a/docs/ensureLink-sync.md +++ b/docs/ensureLink-sync.md @@ -2,6 +2,9 @@ Ensures that the link exists. If the directory structure does not exist, it is created. +- `srcpath` `` +- `dstpath` `` + ## Example: ```js diff --git a/docs/ensureLink.md b/docs/ensureLink.md index 8207ae4..3cf38c5 100644 --- a/docs/ensureLink.md +++ b/docs/ensureLink.md @@ -2,6 +2,10 @@ Ensures that the link exists. If the directory structure does not exist, it is created. +- `srcpath` `` +- `dstpath` `` +- `callback` `` + ## Example: ```js diff --git a/docs/ensureSymlink-sync.md b/docs/ensureSymlink-sync.md index 3f8c6ea..328d4c4 100644 --- a/docs/ensureSymlink-sync.md +++ b/docs/ensureSymlink-sync.md @@ -2,6 +2,10 @@ Ensures that the symlink exists. If the directory structure does not exist, it is created. +- `srcpath` `` +- `dstpath` `` +- `type` `` + ## Example: ```js diff --git a/docs/ensureSymlink.md b/docs/ensureSymlink.md index a5e3517..b6c9695 100644 --- a/docs/ensureSymlink.md +++ b/docs/ensureSymlink.md @@ -2,6 +2,11 @@ Ensures that the symlink exists. If the directory structure does not exist, it is created. +- `srcpath` `` +- `dstpath` `` +- `type` `` +- `callback` `` + ## Example: ```js diff --git a/docs/move-sync.md b/docs/move-sync.md index 8f392e3..cd701fe 100644 --- a/docs/move-sync.md +++ b/docs/move-sync.md @@ -2,8 +2,10 @@ Moves a file or directory, even across devices. -## Options: -- overwrite (boolean): overwrite existing file or directory, default is `false` +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `false`. ## Example: @@ -13,6 +15,8 @@ const fs = require('fs-extra') fs.moveSync('/tmp/somefile', '/tmp/does/not/exist/yet/somefile') ``` +**Using `overwrite` option** + ```js const fs = require('fs-extra') diff --git a/docs/move.md b/docs/move.md index 82c42a8..547af7c 100644 --- a/docs/move.md +++ b/docs/move.md @@ -2,8 +2,11 @@ Moves a file or directory, even across devices. -## Options: -- overwrite (boolean): overwrite existing file or directory, default is `false` +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `false`. +- `callback` `` ## Example: @@ -17,6 +20,8 @@ fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile', err => { }) ``` +**Using `overwrite` option** + ```js const fs = require('fs-extra') diff --git a/docs/outputFile-sync.md b/docs/outputFile-sync.md index d554332..38eee8b 100644 --- a/docs/outputFile-sync.md +++ b/docs/outputFile-sync.md @@ -2,6 +2,10 @@ 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` `` +- `data` ` | | ` +- `options` ` | ` + ## Example: ```js diff --git a/docs/outputFile.md b/docs/outputFile.md index 637a11b..494cba3 100644 --- a/docs/outputFile.md +++ b/docs/outputFile.md @@ -2,6 +2,11 @@ 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). +- `file` `` +- `data` ` | | ` +- `options` ` | ` +- `callback` `` + ## Example: ```js diff --git a/docs/outputJson-sync.md b/docs/outputJson-sync.md index fe2d702..cab6316 100644 --- a/docs/outputJson-sync.md +++ b/docs/outputJson-sync.md @@ -1,10 +1,14 @@ -# outputJsonSync(file, data, [options]) +# 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` `` +- `object` `` +- `options` `` + ## Example: ```js diff --git a/docs/outputJson.md b/docs/outputJson.md index 8cce8bd..58917b8 100644 --- a/docs/outputJson.md +++ b/docs/outputJson.md @@ -1,11 +1,14 @@ -# outputJson(file, data, [options], callback) +# outputJson(file, object, [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()` -**Sync:** `outputJsonSync()`, `outputJSONSync()` +- `file` `` +- `object` `` +- `options` `` +- `callback` `` ## Example: diff --git a/docs/readJson-sync.md b/docs/readJson-sync.md index cd76237..a135637 100644 --- a/docs/readJson-sync.md +++ b/docs/readJson-sync.md @@ -5,6 +5,9 @@ that you'd pass to [`jsonFile.readFileSync`](https://github.com/jprichardson/nod **Alias:** `readJSONSync()` +- `file` `` +- `options` `` + ## Example: ```js diff --git a/docs/readJson.md b/docs/readJson.md index 1392944..acaf19c 100644 --- a/docs/readJson.md +++ b/docs/readJson.md @@ -5,6 +5,10 @@ that you'd pass to [`jsonFile.readFile`](https://github.com/jprichardson/node-js **Alias:** `readJSON()` +- `file` `` +- `options` `` +- `callback` `` + ## Example: ```js diff --git a/docs/remove-sync.md b/docs/remove-sync.md index 1925f24..fe0cc4e 100644 --- a/docs/remove-sync.md +++ b/docs/remove-sync.md @@ -2,6 +2,8 @@ Removes a file or directory. The directory can have contents. Like `rm -rf`. +- `dir` `` + ## Example: ```js diff --git a/docs/remove.md b/docs/remove.md index 136cdd9..267467b 100644 --- a/docs/remove.md +++ b/docs/remove.md @@ -2,6 +2,9 @@ Removes a file or directory. The directory can have contents. Like `rm -rf`. +- `dir` `` +- `callback` `` + ## Example: ```js diff --git a/docs/writeJson-sync.md b/docs/writeJson-sync.md index 1d7022d..9e649bb 100644 --- a/docs/writeJson-sync.md +++ b/docs/writeJson-sync.md @@ -5,6 +5,10 @@ you'd pass to [`jsonFile.writeFileSync()`](https://github.com/jprichardson/node- **Alias:** `writeJSONSync()` +- `file` `` +- `object` `` +- `options` `` + ## Example: ```js diff --git a/docs/writeJson.md b/docs/writeJson.md index d76bbfd..3f8f042 100644 --- a/docs/writeJson.md +++ b/docs/writeJson.md @@ -5,6 +5,11 @@ you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-json **Alias:** `writeJSON()` +- `file` `` +- `object` `` +- `options` `` +- `callback` `` + ## Example: ```js