Skip to content

Commit

Permalink
feat: expose Parser from require('yargs/yargs') (#1477)
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyfarrell authored and bcoe committed Nov 10, 2019
1 parent afd5b48 commit 1840ba2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/parser.js
@@ -0,0 +1,11 @@
'use strict'
/* global it */

const yargs = require('../yargs')
const Parser = require('yargs-parser')

require('chai').should()

it('should expose yargs-parser as Parser', () => {
yargs.Parser.should.equal(Parser)
})
3 changes: 3 additions & 0 deletions yargs.js
Expand Up @@ -1221,6 +1221,9 @@ function Yargs (processArgs, cwd, parentRequire) {
return self
}

// allow consumers to directly use the version of yargs-parser used by yargs
exports.Parser = Parser

// rebase an absolute path to a relative one with respect to a base directory
// exported for tests
exports.rebase = rebase
Expand Down

0 comments on commit 1840ba2

Please sign in to comment.