Skip to content

Commit

Permalink
readme: document copySync. Closes #116
Browse files Browse the repository at this point in the history
  • Loading branch information
jprichardson committed Dec 17, 2015
1 parent b2e6f2d commit b002e35
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var fse = require('fs-extra')
Methods
-------
- [copy](#copy)
- [copySync](#copy)
- [copySync](#copySync)
- [createOutputStream](#createoutputstreamfile-options)
- [emptyDir](#emptydirdir-callback)
- [emptyDirSync](#emptydirdir-callback)
Expand Down Expand Up @@ -104,10 +104,7 @@ clobber (boolean): overwrite existing file or directory
preserveTimestamps (boolean): will set last modification and access times to the ones of the original source files, default is `false`.
filter: Function or RegExp to filter copied files. If function, return true to include, false to exclude. If RegExp, same as function, where `filter` is `filter.test`.

Sync: `copySync()`


Examples:
Example:

```js
var fs = require('fs-extra')
Expand All @@ -123,6 +120,26 @@ fs.copy('/tmp/mydir', '/tmp/mynewdir', function (err) {
}) // copies directory, even if it has subdirectories or files
```

### copySync()

**copySync(src, dest, [options])**

Synchronously copies a file or directory. The directory can have contents.


Example:

```js
var fs = require('fs-extra')

try {
fs.copySync('/tmp/mydir', '/tmp/mynewdir'
} catch (err) {
console.error('Oh no, there was an error: ' + err.message)
}
```
### createOutputStream(file, [options])
Expand Down

0 comments on commit b002e35

Please sign in to comment.