$ npm install @envelop/parser-cache
@envelop/parser-cacheThis 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).
yarn add @envelop/parser-cache
import { envelop } from '@envelop/core';
import { useParserCache } from '@envelop/parser-cache';
const getEnveloped = envelop({
plugins: [
// ... other plugins ...
useParserCache({
// options goes here
}),
],
});
maxSet this to configure your maximum amount of items in the LRU cache. The default is 1000.
ttlSet this to configure the TTL (time to live) of items in the LRU cache. The default is 3600000.
© 2010 - cnpmjs.org x YWFE | Home | YWFE