# @envelop/parser-cache

Latest version **11.0.1** (published 2026-11-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @envelop/parser-cache
pnpm add @envelop/parser-cache
yarn add @envelop/parser-cache
bun add @envelop/parser-cache
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 11.0.1 |
| Published | 2026-11-12 |
| First published | 2021-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.15.0 |
| Dependencies | 2 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 8541 |
| Author | Dotan Simha <dotansimha@gmail.com> |
| Maintainers | dotansimha, enisdenjo, theguild-bot |

## Links

- npm: https://www.npmjs.com/package/@envelop/parser-cache
- Repository: https://github.com/graphql-hive/graphql-yoga
- Homepage: https://github.com/graphql-hive/graphql-yoga/tree/main/packages/envelop/plugins/parser-cache#readme
- npm.io page: https://npm.io/package/@envelop/parser-cache

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^2.5.0
- [lru-cache](https://npm.io/package/lru-cache.md) ^11.0.0

## Recent versions

- 11.0.1 (latest) — 2026-11-12
- 11.0.1-alpha-20261112141330-38ba3951f67b0d318166a9440eade51b2f5e9cf9 (alpha) — 2026-11-12
- 11.0.1-rc-20261112141317-184086d94be0f21d781bea0446e4791b6a018507 (rc) — 2026-11-12
- 11.0.1-rc-20261111185655-c5cf052ddf41ad176b870cc0d16f11174fab5c0b — 2026-11-11
- 11.0.1-alpha-20261111175152-e39c721ee7ae5562ccdc6db5ec8239098e4af153 — 2026-11-11
- 11.0.0 — 2026-10-22
- 11.0.0-rc-20261022165416-7c29decb398764e6ac3915e1c539c478cbf19237 — 2026-10-22
- 11.0.0-alpha-20261019231601-b21e6cedc1a444383d9ce69fe6180f5b4ff67120 — 2026-10-19
- 11.0.0-alpha-20261019165905-4e993e96c2903cbe3084f9b49dfbf05042e3fe57 — 2026-10-19
- 11.0.0-alpha-20261019135505-9270088a653c3b9c07f54ef1cb67e69488e4e188 — 2026-10-19
- 11.0.0-alpha-20261009120802-464ace7b331b5693c49d18e270d79cb071e59247 — 2026-10-09
- 11.0.0-alpha-20261006205119-381bef34d7da2fde417073fec18c06eb58224f87 — 2026-10-06
- 11.0.0-alpha-20260929215310-f756e1d4981e8dd5ac5e128b5c2554893ae24a52 — 2026-09-29
- 10.2.1 — 2026-09-16
- 10.2.0 — 2026-08-19
- … 1615 more at https://npm.io/package/@envelop/parser-cache/versions

## README

## `@envelop/parser-cache`

This plugins adds simple LRU caching to your `parse`, to improve performance by caching the parsed
result.

This plugins improves performance of parsing by ~60% (based on benchmarks).

## Getting Started

```
yarn add @envelop/parser-cache
```

## Usage Example

```ts
import { execute, parse, specifiedRules, subscribe, validate } from 'graphql'
import { envelop, useEngine } from '@envelop/core'
import { useParserCache } from '@envelop/parser-cache'

const getEnveloped = envelop({
  plugins: [
    useEngine({ parse, validate, specifiedRules, execute, subscribe }),
    // ... other plugins ...
    useParserCache({
      // options goes here
    })
  ]
})
```

### API Reference

#### `documentCache`

Set this to pass in a cache instance for caching documents. By default a new LRU cache is created
using default `max` and `ttl`.

#### `errorCache`

Set this to pass in a cache instance for caching errors. By default a new LRU cache is created using
default `max` and `ttl`.

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