A small Node.js utility that checks whether a given CLI argument list (defaults to process.argv) contains a specific flag, returning true or false. It supports checking short and long flags and stops searching after an -- argument terminator.
Project status
- The upstream repo (sindresorhus/has-flag) shows maintenance activity at least through mid-2021, with no evidence of updates beyond the 2021-07-19 push in the provided data.
- Apparent update cadence: v4.0.0 in 2019-04, then a major update in 2021-04 (v5.0.0), followed by a small patch update in 2021-07 (v5.0.1), after which the timeline goes quiet.
AI summary generated Today
Recent updates
v5.0.1
7/19/2021Release v5.0.1 makes a small change related to how `process` is accessed. It updates the package version and modifies the implementation to explicitly import the `process` module for use as the default source of `process.argv`.
v5.0.0
4/16/2021v5.0.0 is a major release of has-flag that raises the minimum Node.js version to Node 12 and switches the package to pure ESM. The code changes are small, but they include packaging and TypeScript surface-area adjustments that can affect consumers relying on CommonJS or deep imports.
Breakingv4.0.0
4/6/2019v4.0.0 introduces TypeScript type definitions and updates the supported runtime requirements. The primary upgrade concern is that the package now requires Node.js 8, which may break older Node versions.
BreakingFeatures