Skip to content
Permalink
Browse files

drop support for `pkg` option accepting a string

You can just `require('./package.json')` instead.
  • Loading branch information...
sindresorhus committed Jul 10, 2016
1 parent c80321d commit 2d4d89043c41030d60ee9eb5130a4fa62935ca37
Showing with 5 additions and 3 deletions.
  1. +1 −1 index.js
  2. +4 −2 readme.md
@@ -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);

@@ -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

0 comments on commit 2d4d890

Please sign in to comment.
You can’t perform that action at this time.