Skip to content
Browse files

Optional `graceful-fs` dep. Closes #17

  • Loading branch information...
1 parent edc2692 commit 05c93f70fc98b91f4041435d4f80ac18b4195433 @jprichardson committed Mar 18, 2013
Showing with 9 additions and 3 deletions.
  1. +1 −1 CHANGELOG.md
  2. +8 −2 lib/index.js
View
2 CHANGELOG.md
@@ -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
View
10 lib/index.js
@@ -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

0 comments on commit 05c93f7

Please sign in to comment.
Something went wrong with that request. Please try again.