fs-extra
Advanced tools
Comparing version 0.11.1 to 0.12.0
@@ -0,1 +1,5 @@ | ||
0.12.0 / 2014-09-22 | ||
------------------- | ||
- copy symlinks in `copySync()` [#85](https://github.com/jprichardson/node-fs-extra/pull/85) | ||
0.11.1 / 2014-09-02 | ||
@@ -2,0 +6,0 @@ ------------------- |
@@ -60,5 +60,6 @@ "use strict" | ||
function copySync(src, dest, filter) { | ||
function copySync(src, dest, filter, recursive) { | ||
filter = filter || function () { return true; }; | ||
var stats = fs.lstatSync(src), | ||
recursive = recursive || false; | ||
var stats = recursive ? fs.lstatSync(src) : fs.statSync(src), | ||
destFolder = path.dirname(dest), | ||
@@ -79,5 +80,8 @@ destFolderExists = fs.exists(destFolder), | ||
contents.forEach(function (content) { | ||
copySync(src + "/" + content, dest + "/" + content, filter); | ||
copySync(src + "/" + content, dest + "/" + content, filter, true); | ||
}); | ||
} else if (recursive && stats.isSymbolicLink()) { | ||
var srcPath = fs.readlinkSync(src); | ||
fs.symlinkSync(srcPath, dest); | ||
} | ||
} |
{ | ||
"name": "fs-extra", | ||
"version": "0.11.1", | ||
"version": "0.12.0", | ||
"description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/jprichardson/node-fs-extra", |
@@ -156,6 +156,10 @@ Node.js: fs-extra | ||
### move(src, dest, callback) | ||
### move(src, dest, [options], callback) | ||
Moves a file or directory, even across devices. | ||
Options: | ||
clobber (boolean): overwrite existing file or directory | ||
limit (number): number of concurrent moves, see ncp for more information | ||
Example: | ||
@@ -298,3 +302,27 @@ | ||
Third Party | ||
----------- | ||
### Promises | ||
Use [Bluebird](https://github.com/petkaantonov/bluebird). See https://github.com/petkaantonov/bluebird/blob/master/API.md#promisification. `fs-extra` is | ||
explicitly listed as supported. | ||
```js | ||
var Promise = require("bluebird") | ||
var fs = Promise.promisifyAll(require("fs-extra")) | ||
``` | ||
### TypeScript | ||
If you like TypeScript, you can use `fs-extra` with it: https://github.com/borisyankov/DefinitelyTyped/tree/master/fs-extra | ||
### Misc. | ||
- [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls. | ||
Roadmap | ||
@@ -357,6 +385,6 @@ -------- | ||
- [*] [Uli Köhler](https://github.com/ulikoehler) | ||
- [2] [Sylvain Cleymans](https://github.com/Ackar) | ||
- [1] [Jim Higson](https://github.com/jimhigson) | ||
- [1] [PatrickJS](https://github.com/gdi2290) | ||
- [1] [Michael Tiller](https://github.com/xogeny) | ||
- [1] [Sylvain Cleymans](https://github.com/Ackar) | ||
- `<your name here>` | ||
@@ -363,0 +391,0 @@ |
28056
386
412