@ -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",
@ -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;