diff --git a/package.json b/package.json index 7489a95..c7267dd 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,8 @@ }, "homepage": "https://github.com/lukechilds/requireable", "dependencies": { - "find-root": "^1.1.0", - "mock-require": "^2.0.2" + "mock-require": "^2.0.2", + "pkg-dir": "^2.0.0" }, "devDependencies": { "ava": "^0.19.1", diff --git a/src/index.js b/src/index.js index 8542f64..02398b1 100644 --- a/src/index.js +++ b/src/index.js @@ -1,12 +1,12 @@ 'use strict'; -const findRoot = require('find-root'); +const pkgDir = require('pkg-dir'); const mock = require('mock-require'); const pkg = { success: false }; try { - pkg.path = findRoot(process.cwd()); + pkg.path = pkgDir.sync(); pkg.name = require(pkg.path + '/package.json').name; mock(pkg.name, require(pkg.path)); pkg.success = true;