$ cnpm install @envelop/validation-cache
@envelop/validation-cacheThis plugins adds simple LRU caching to your validate, to improve performance by caching the validation result.
This plugins improves performance of validating by ~50% (based on benchmarks).
yarn add @envelop/validation-cache
import { envelop } from '@envelop/core';
import { useValidationCache } from '@envelop/validation-cache';
const getEnveloped = envelop({
plugins: [
// ... other plugins ...
useValidationCache({
// options goes here
}),
],
});
cacheSet this to pass in a cache instance. By default a new LRU cache is created using default max and ttl.
Copyright 2013 - present © cnpmjs.org | Home |