Skip to content

Commit 4633d39

Browse files
authored
docs: switch example to use ESM version of yargs (#80)
1 parent d2d3979 commit 4633d39

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

index.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ <h1 class="pink-highlight">Yargs be a node.js library fer hearties tryin' ter pa
6161
<code class="hljs language-javascript">
6262
#!/usr/bin/env node
6363

64-
require('yargs')
64+
import yargs from 'yargs';
65+
import { hideBin } from 'yargs/helpers';
66+
67+
yargs()
6568
.scriptName("pirate-parser")
6669
.usage('$0 &lt;cmd&gt; [args]')
6770
.command('hello [name]', 'welcome ter yargs!', (yargs) => {
@@ -74,7 +77,7 @@ <h1 class="pink-highlight">Yargs be a node.js library fer hearties tryin' ter pa
7477
console.log('hello', argv.name, 'welcome to yargs!')
7578
})
7679
.help()
77-
.argv
80+
.parse(hideBin(process.argv))
7881

7982
</code>
8083
</pre>

0 commit comments

Comments
 (0)