# @adobe/helix-shared-indexer

> Shared modules of the Helix Project - Indexer

Latest version **2.2.11** (published 2026-10-27) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @adobe/helix-shared-indexer
pnpm add @adobe/helix-shared-indexer
yarn add @adobe/helix-shared-indexer
bun add @adobe/helix-shared-indexer
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.2.11 |
| Published | 2026-10-27 |
| First published | 2021-11-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 64.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 15 |
| Maintainers | marbec, tripod, garthdb, lazd, adobe-admin, patrickfulton, trieloff, krisnye, dcpfsdk, natebaldwin, devongovett, aspro83, symanovi, dpfister, stefan-guggisberg, rofe, kptdobe, adobehalls, fullcolorcoder, djaeggi, dylandepass, mhaack, amol-anand, stopp-adobe, namarora, doten, duh_schmidt, asthabh23, aljoseph, zdahbi, tuicu, fmeschbe |

## Links

- npm: https://www.npmjs.com/package/@adobe/helix-shared-indexer
- Repository: https://github.com/adobe/helix-shared
- Homepage: https://github.com/adobe/helix-shared#readme
- Issues: https://github.com/adobe/helix-shared/issues
- npm.io page: https://npm.io/package/@adobe/helix-shared-indexer

## Dependencies (8)

- [jsep](https://npm.io/package/jsep.md) 1.6.0
- [dayjs](https://npm.io/package/dayjs.md) 1.11.23
- [unified](https://npm.io/package/unified.md) 11.0.5
- [micromatch](https://npm.io/package/micromatch.md) 4.0.8
- [rehype-parse](https://npm.io/package/rehype-parse.md) 9.0.1
- [hast-util-select](https://npm.io/package/hast-util-select.md) 6.0.4
- [hast-util-to-html](https://npm.io/package/hast-util-to-html.md) 9.0.5
- [hast-util-to-text](https://npm.io/package/hast-util-to-text.md) 4.0.2

## Recent versions

- 2.2.11 (latest) — 2026-10-27
- 2.2.10 — 2026-08-31
- 2.2.9 — 2026-07-01
- 2.2.8 — 2026-06-16
- 2.2.7 — 2026-03-30
- 2.2.6 — 2025-11-18
- 2.2.5 — 2025-09-01
- 2.2.4 — 2025-08-18
- 2.2.3 — 2025-02-24
- 2.2.2 — 2024-12-14
- 2.2.1 — 2024-11-09
- 2.2.0 — 2024-11-07
- 2.1.7 — 2024-10-12
- 2.1.6 — 2024-09-28
- 2.1.5 — 2024-09-21
- … 92 more at https://npm.io/package/@adobe/helix-shared-indexer/versions

## README

# Helix Shared - Indexer

## Reference

In your `helix-query.yaml` <sup>[1](#footnote1)</sup>, you can define one or more index definitions. A sample index definition looks as follows:

```
indices:
  mysite:
    source: html
    fetch: https://{ref}--{repo}--{owner}.project-helix.page/{path}
    properties:
      author:
        select: main > div:nth-of-type(3) > p:nth-of-type(1)
        value: |
          match(el, 'by (.*)')
```

The `select` property is a CSS selector that grabs HTML elements out of your document. To verify that a CSS selector entered
is selecting what you expect, you can test it in your browser's Javascript console, e.g. for the `author` selector shown above,
enter the following expression:
```
document.querySelectorAll('main > div:nth-of-type(3) > p:nth-of-type(1)');
```

The `value` or `values` property contains an expression to apply to all HTML elements selected. The property name `value` is preferred
when you need a string, `values` on the other hand provides you with an array of all the matches found. The expression can contain
a combination of functions and variables:

### innerHTML(el)

Returns the HTML content of an element.

### textContent(el)

Returns the text content of the selected element, and all its descendents.

### attribute(el, name)

Returns the value of the attribute with the specified name of an element.

### match(el, re)

Matches a regular expression containing parentheses to capture items in the passed element.
In the `author` example above, the actual contents of the `<p>` element selected might
contain `by James Brown`, so it would capture everything following `by `.

### words(el, start, end)

Useful for teasers, this selects a range of words out of an HTML element.

### replace(el, substr, newSubstr)

Replaces all occurrences of a substring in a text with a replacement.

### parseTimestamp(el, format)

Parses a timestamp given as string, and returns its value as number of seconds since 1 Jan 1970.

### el

Returns the HTML elements selected by the `select` property.

### path

Returns the path of the HTML document being indexed.

### headers[name]

Returns the value of the HTTP response header with the specified name, at the time the HTML document was fetched.


<a name="footnote1">[1]</a>: The full definition of the `helix-query.yaml` is available here: https://github.com/adobe/helix-shared/blob/main/docs/indexconfig.md

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