Skip to content

Commit ee71917

Browse files
shadowspawnEomm
andauthored
docs: add table of matching versions (#138)
Co-authored-by: Manuel Spigolon <[email protected]>
1 parent 91bfb4d commit ee71917

File tree

1 file changed

+16
-23
lines changed

1 file changed

+16
-23
lines changed

README.md

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,15 @@ $ node negate.js --no-logfile --logfile=test.log --color --no-color
209209
<!-- omit in toc -->
210210
## Table of Contents
211211
- [`util.parseArgs([config])`](#utilparseargsconfig)
212-
- [Scope](#scope)
213-
- [Links & Resources](#links--resources)
212+
- [Scope](#scope)
213+
- [Version Matchups](#version-matchups)
214214
- [🚀 Getting Started](#-getting-started)
215215
- [🙌 Contributing](#-contributing)
216216
- [💡 `process.mainArgs` Proposal](#-processmainargs-proposal)
217217
- [Implementation:](#implementation)
218-
- [💡 `util.parseArgs([config])` Proposal](#-utilparseargsconfig-proposal)
219218
- [📃 Examples](#-examples)
220-
- [F.A.Qs](#faqs)
219+
- [F.A.Qs](#faqs)
220+
- [Links & Resources](#links--resources)
221221
222222
-----
223223
@@ -227,6 +227,16 @@ It is already possible to build great arg parsing modules on top of what Node.js
227227
228228
It is exceedingly difficult to provide an API which would both be friendly to these Node.js users while being extensible enough for libraries to build upon. We chose to prioritize these use cases because these are currently not well-served by Node.js' API.
229229
230+
----
231+
232+
## Version Matchups
233+
234+
| Node.js | @pkgjs/parseArgs |
235+
| -- | -- |
236+
| [v18.3.0](https://nodejs.org/docs/latest-v18.x/api/util.html#utilparseargsconfig) | [v0.9.1](https://github.com/pkgjs/parseargs/tree/v0.9.1#utilparseargsconfig) |
237+
238+
----
239+
230240
## 🚀 Getting Started
231241
232242
1. **Install dependencies.**
@@ -267,24 +277,6 @@ process.mainArgs = process.argv.slice(process._exec ? 1 : 2)
267277
268278
----
269279
270-
## 💡 `util.parseArgs([config])` Proposal
271-
272-
* `config` {Object} (Optional) The `config` parameter is an
273-
object supporting the following properties:
274-
* `args` {string[]} (Optional) Array of argument strings; defaults
275-
to [`process.mainArgs`](process_argv)
276-
* `options` {Object} (Optional) An object describing the known options to look for in `args`; `options` keys are the long names of the known options, and the values are objects with the following properties:
277-
* `type` {'string'|'boolean'} (Required) Type of known option
278-
* `multiple` {boolean} (Optional) If true, when appearing one or more times in `args`, results are collected in an `Array`
279-
* `short` {string} (Optional) A single character alias for an option; When appearing one or more times in `args`; Respects the `multiple` configuration
280-
* `strict` {Boolean} (Optional) A `Boolean` for whether or not to throw an error when unknown options are encountered, `type:'string'` options are missing an options-argument, or `type:'boolean'` options are passed an options-argument; defaults to `true`
281-
* `allowPositionals` {Boolean} (Optional) Whether this command accepts positional arguments. Defaults `false` if `strict` is `true`, otherwise defaults to `true`.
282-
* Returns: {Object} An object having properties:
283-
* `values` {Object}, key:value for each option found. Value is a string for string options, or `true` for boolean options, or an array (of strings or booleans) for options configured as `multiple:true`.
284-
* `positionals` {string[]}, containing [Positionals][]
285-
286-
----
287-
288280
## 📃 Examples
289281
290282
```js
@@ -344,8 +336,9 @@ const { values, positionals } = parseArgs({ strict: false, args, options, allowP
344336
// positionals = ['b']
345337
```
346338
339+
----
347340
348-
### F.A.Qs
341+
## F.A.Qs
349342
350343
- Is `cmd --foo=bar baz` the same as `cmd baz --foo=bar`?
351344
- yes

0 commit comments

Comments
 (0)