# @npmcli/query

> npm query parser and tools

Latest version **6.0.0** (published 2026-05-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install @npmcli/query
pnpm add @npmcli/query
yarn add @npmcli/query
bun add @npmcli/query
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 6.0.0 |
| Published | 2026-05-08 |
| First published | 2022-06-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^22.22.2 \|\| ^24.15.0 \|\| >=26.0.0 |
| Dependencies | 1 |
| Unpacked size | 10.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 8 |
| Author | GitHub Inc. |
| Maintainers | saquibkhan, npm-cli-ops, reggi, owlstronaut |
| Keywords | ast, npm, npmcli, parser, postcss, postcss-selector-parser, query |

## Links

- npm: https://www.npmjs.com/package/@npmcli/query
- Repository: https://github.com/npm/query
- Homepage: https://github.com/npm/query#readme
- Issues: https://github.com/npm/query/issues
- npm.io page: https://npm.io/package/@npmcli/query

## Dependencies (1)

- [postcss-selector-parser](https://npm.io/package/postcss-selector-parser.md) ^7.0.0

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 6.0.0 (latest) — 2026-05-08
- 5.0.0 — 2025-10-22
- 4.0.1 — 2025-04-09
- 4.0.0 — 2024-09-05
- 3.1.0 — 2024-02-23
- 3.0.1 — 2023-09-12
- 3.0.0 — 2022-10-11
- 2.0.0 — 2022-09-20
- 1.2.0 — 2022-08-18
- 1.1.1 — 2022-08-03
- 1.1.0 — 2022-06-28
- 1.0.2 — 2022-06-27
- 1.0.1 — 2022-06-08
- 1.0.0 — 2022-06-08

## README

# @npmcli/query

Parser and tools for `npm query`.

## parser(str)

The `parser` method receives a query `string` and parses that string using
[`postcss-selector-parser`](https://www.npmjs.com/package/postcss-selector-parser),
it then modifies the returned ast to include information that is then essential
to translate that structure into navigating
[Arborist](https://github.com/npm/cli/tree/latest/workspaces/arborist).

## LICENSE

[ISC](./LICENSE)

---
_Source: https://npm.io/package/@npmcli/query · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
