mirror of https://github.com/lukechilds/this.git
Browse Source
It makes the code slightly simpler and it’s by me. https://github.com/sindresorhus/pkg-dirpull/2/head
Sindre Sorhus
7 years ago
2 changed files with 3 additions and 4 deletions
@ -1,10 +1,9 @@ |
|||
'use strict'; |
|||
|
|||
const findRoot = require('find-root'); |
|||
const pkgDir = require('pkg-dir'); |
|||
|
|||
try { |
|||
const modulePath = findRoot(process.cwd()); |
|||
module.exports = require(modulePath); |
|||
module.exports = require(pkgDir.sync()); |
|||
} catch (err) { |
|||
module.exports = undefined; |
|||
} |
|||
|
Loading…
Reference in new issue