Skip to main content

@nestjs-mod/keyv

Simple key-value storage with support for multiple backends, and a consistent interface for NestJS-mod (Wrapper for https://www.npmjs.com/package/keyv)

NPM version monthly downloads Telegram Discord

Installation

npm i --save keyv@5.2.3 @nestjs-mod/keyv

Modules

LinkCategoryDescription
KeyvModulecoreSimple key-value storage with support for multiple backends, and a consistent interface for NestJS-mod (Wrapper for https://www.npmjs.com/package/keyv)

Modules descriptions

KeyvModule

Simple key-value storage with support for multiple backends, and a consistent interface for NestJS-mod (Wrapper for https://www.npmjs.com/package/keyv)

Shared providers

KeyvService

Environments

KeyDescriptionSourcesConstraintsDefaultValue
urlConnection string for store data (example: redis://:redis_password@localhost:6379)obj['url'], process.env['KEYV_URL']optional--

Static configuration

KeyDescriptionConstraintsDefaultValue
defaultLoggerDefault loggeroptional--
featureNameFeature name for generate prefix to environments keysoptional--
emitErrorsEmit errors.optionaltrue-
namespaceNamespace for the current instance.optional--
serializeA custom serialization function.optionaldefault-
deserializeA custom deserialization function.optionaldefault-
storeThe storage adapter instance to be used by Keyv.optional--
storeFactoryByEnvironmentUrlFunction for create storage adapter instance to be used by Keyv by environment url.optional--
ttlDefault TTL. Can be overridden by specifying a TTL on .set().optional--
compressionEnable compression option.optional--
statsEnable or disable statistics (default is false)optionalfalse-
useKeyPrefixEnable or disable key prefixing (default is true)optionaltrue-

Back to Top

License

MIT