split.js
This file
Path
examples/split.js
18 lines · 464 bytes · JavaScript
Last changed by
Use standard import in examples (#2168)John Geebefore adoption41b12cf
History of this fileTake it
Use standard import in examples (#2168)John Geebefore adoption41b12cf
line 1why, one step back1const { program } = require('commander');Merge pull request #1683 from tj/release/9.xJohn Geebefore adoption02a124c
lines 2–18why, one step back23// This is used as an example in the README for the Quick Start.45program6 .option('--first')7 .option('-s, --separator <char>');89program.parse();1011const options = program.opts();12const limit = options.first ? 1 : undefined;13console.log(program.args[0].split(options.separator, limit));1415// Try the following:16// node split -s / --fits a/b/c17// node split -s / --first a/b/c18// node split --separator=, a,b,c