Skip to content

Commit

Permalink
drop support for pkg option accepting a string
Browse files Browse the repository at this point in the history
You can just `require('./package.json')` instead.
  • Loading branch information
sindresorhus committed Jul 10, 2016
1 parent c80321d commit 2d4d890
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = (opts, minimistOpts) => {
minimistOpts.string.splice(index, 1);
}

const pkg = typeof opts.pkg === 'string' ? require(path.join(parentDir, opts.pkg)) : opts.pkg;
const pkg = opts.pkg;
const argv = minimist(opts.argv, minimistOpts);
let help = redent(trimNewlines((opts.help || '').replace(/\t+\n*$/, '')), 2);

Expand Down
6 changes: 4 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,12 @@ Set it to `false` to disable it altogether.

##### pkg

Type: `string` `Object`<br>
Type: `Object`<br>
Default: Closest package.json upwards

Relative path to package.json or as an `Object`.
package.json as an `Object`.

*You most likely don't need this option.*

##### argv

Expand Down

0 comments on commit 2d4d890

Please sign in to comment.