@envelop/parser-cache
This plugins adds simple LRU caching to your `parse`, to improve performance by caching the parsed result.
Last updated 5 years ago by dotansimha .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @envelop/parser-cache 
SYNC missed versions from official npm registry.

@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

import { envelop } from '@envelop/core';
import { useParserCache } from '@envelop/parser-cache';

const getEnveloped = envelop({
  plugins: [
    // ... other plugins ...
    useParserCache({
      // options goes here
    }),
  ],
});

API Reference

max

Set this to configure your maximum amount of items in the LRU cache. The default is 1000.

ttl

Set this to configure the TTL (time to live) of items in the LRU cache. The default is 3600000.

Current Tags

1625 Versions

Maintainers (1)
Downloads
Total 1,090
Today 0
This Week 15
This Month 395
Last Day 1
Last Week 49
Last Month 695
Dependencies (1)
Dev Dependencies (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE