Back to Explore

npm/nopt

GitHub
2 updates · last 90 days1 watchersOpen source

Last release:

nopt (Node/npm Option Parsing) is a Node.js utility for parsing command-line options into a structured config object based on known option types, shorthands, and parsing rules. It is useful in CLI programs that need validation (for example strings, numbers, booleans, paths, URLs, arrays) and convenience features like boolean negation, option abbreviation, and returning remaining arguments via a parsed `argv` field.

Project status

  • npm/nopt appears actively maintained, with recent updates in 2025-10-22 (v9.0.0), 2026-05-15 (v10.0.0), and 2026-06-04 (v10.0.1), and an upstream push as recently as 2026-06-18.
  • The apparent recent cadence is about 1 to 2 months between updates (v10.0.0 to v10.0.1), suggesting ongoing evolution rather than maintenance mode.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v10.0.1

    v10.0.1 is a maintenance release focused on documentation updates and a development tooling bump. The only user-facing change shown in the diff is an adjustment to the README error handling section regarding debug/notification behavior.

  • v10.0.0

    v10.0.0 updates nopt to support newer Node.js versions, removes internal debug logging, and modernizes URL parsing away from the deprecated legacy url.parse API. The release also updates the project tooling to use Node's built-in test runner (node:test) instead of tap.

    BreakingFeatures
  • v9.0.0

    Release v9.0.0 mainly updates the supported Node.js engine range and bumps the `abbrev` dependency to the next major version. The diff also shows CI/workflow configuration updates (permissions, Node test matrix versions) and project tooling template changes, with no library source code changes included in the provided diff.

    Breaking
  • v8.1.0

    v8.1.0 adds two new handler hooks, `unknownHandler` and `abbrevHandler`, to let consumers observe or customize how `nopt` reacts to unknown options and abbreviation-based option expansion. It also updates the `abbrev` dependency (2.x to 3.x) and adjusts dependency tooling versions.

    Features
  • v8.0.0

    v8.0.0 primarily updates the supported Node.js engine range, aligning nopt with newer npm expectations. The code diff provided does not show any changes to nopt's core option parsing logic, so the main impact for developers is environment and tooling updates.

    Breaking
  • v7.2.1

    v7.2.1 is a patch release that, per the notes, includes a lint-only fix for unused variables and a tooling chore bump of @npmcli/template-oss. The code diff also shows extensive CI, release automation, and repo tooling changes generated by template-oss, while the runtime library change appears to be only an ESLint suppression comment.

  • v7.2.0

    v7.2.0 adds support for a configurable fallback for resolving option types, plus the ability to provide a custom typeDefault that influences how unknown values are cleaned and validated. The release also includes some CI and repository hygiene changes, alongside minor test and bin cleanup.

    Features
  • v7.1.0

    v7.1.0 adds a new exported `lib` entry point to allow using nopt without relying on the singleton/global configuration pattern. The release notes also mention a small bug fix described as removing dead code, with no documented breaking API changes.

    Features
  • v7.0.0

    v7.0.0 updates the package to require newer Node.js versions, and bumps the runtime dependency abbrev to 2.0.0. The included code diff is dominated by repository automation changes (GitHub workflows, template-oss integration, CodeQL action versions), plus some package.json configuration updates.

    BreakingFeatures
  • v6.0.0

    Release v6.0.0 removes support for older Node.js versions, specifically Node 6 through 10 and non-LTS versions of Node 12 and 14. It also includes some maintenance bug fixes (notably avoiding deprecated String.prototype.substr) and a small dependency-related adjustment.

    Breaking