Skip to content

Commit

Permalink
Optional graceful-fs dep. Closes #17
Browse files Browse the repository at this point in the history
  • Loading branch information
jprichardson committed Mar 18, 2013
1 parent edc2692 commit 05c93f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* removed node 0.6 support
* added node 0.10 support
* upgraded to latest `ncp` and `rimraf`.
* optional `graceful-fs` support. See #17
* optional `graceful-fs` support. Closes #17


0.5.0 / 2013-02-03
Expand Down
10 changes: 8 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
var fs = require('fs')
var fs = null
, path = require('path')
, jsonFile = require('jsonfile')
, fse = {};

try {
// optional dependency
fs = require("graceful-fs")
} catch (er) {
fs = require("fs")
}

Object.keys(fs).forEach(function(key) {
var func = fs[key];
if (typeof func == 'function')
fse[key] = func;
});


fs = fse;

// copy
Expand Down

0 comments on commit 05c93f7

Please sign in to comment.