UNPKG

@nasriya/cachify

Version:

A lightweight, extensible in-memory caching library for storing anything, with built-in TTL and customizable cache types.

51 lines (50 loc) 1.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CACHE_FLAVORS = exports.CACHE_PRELOAD_INITIATORS = exports.STREAM_CIPHER_IV_SIZE = exports.STREAM_CIPHER_BLOCK_SIZE = exports.BACKUP_STORAGE_SERVICES = exports.OBJECT_OVERHEAD = void 0; /** * The overhead for each object in the cache in bytes. * @constant * @since 1.0.0 */ exports.OBJECT_OVERHEAD = 24; /** * The list of backup storage services that are supported by cachify. * @constant * @since 1.0.0 */ exports.BACKUP_STORAGE_SERVICES = ['local', 's3', /*'gcs', 'azure', 'ftp', 'sftp', 'redis'*/]; /** * The block size for the stream cipher in bytes. * **Value**: `1_048_576` = 1 MB; * @constant * @since 1.0.0 */ exports.STREAM_CIPHER_BLOCK_SIZE = 1_048_576; /** * The IV size for the stream cipher in bytes. * **Value**: `16` = 16 bytes; * @constant * @since 1.0.0 */ exports.STREAM_CIPHER_IV_SIZE = 16; /** * The list of `preload` initiators that are supported by cachify. * @constant * @since 1.0.0 */ exports.CACHE_PRELOAD_INITIATORS = ['warmup', 'restore']; /** * The list of cache flavors that are supported by cachify. * @constant * @since 1.0.0 */ exports.CACHE_FLAVORS = ['kvs', 'files', /*'database'*/]; const constants = { OBJECT_OVERHEAD: exports.OBJECT_OVERHEAD, BACKUP_STORAGE_SERVICES: exports.BACKUP_STORAGE_SERVICES, STREAM_CIPHER_BLOCK_SIZE: exports.STREAM_CIPHER_BLOCK_SIZE, STREAM_CIPHER_IV_SIZE: exports.STREAM_CIPHER_IV_SIZE, CACHE_PRELOAD_INITIATORS: exports.CACHE_PRELOAD_INITIATORS, CACHE_FLAVORS: exports.CACHE_FLAVORS, }; exports.default = constants;