diff --git a/index.js b/index.js index 07df295..7111e15 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,9 @@ -var _fs = require('fs') +var _fs +try { + _fs = require('graceful-fs') +} catch (_) { + _fs = require('fs') +} function readFile (file, options, callback) { if (callback == null) { diff --git a/package.json b/package.json index d4fb32d..8e39384 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,9 @@ "author": "JP Richardson ", "license": "MIT", "dependencies": {}, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + }, "devDependencies": { "mocha": "2.x", "mock-fs": "^3.8.0",