diff --git a/README.md b/README.md index 314b501..adf96e8 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,13 @@ fanciful decoration. # example +Example files: [example/parse.js](./example/parse.js) (CommonJS) / [example/parse.mjs](./example/parse.mjs) (ECMAScript) + ``` js -var argv = require('minimist')(process.argv.slice(2)); +const minimist = require('minimist'); // (for CommonJS) +// import minimist from 'minimist'; // (for ECMAScript) + +const argv = minimist(process.argv.slice(2)); console.log(argv); ``` @@ -42,10 +47,10 @@ $ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop --no-ding foo bar baz # methods ``` js -var parseArgs = require('minimist') +const parseArgs = require('minimist') ``` -## var argv = parseArgs(args, opts={}) +## const argv = parseArgs(args, opts={}) Return an argument object `argv` populated with the array arguments from `args`.