UNPKG

key-file-storage

Version:

Simple key-value storage directly on file system, maps each key to a separate file.

22 lines (21 loc) 859 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.keyFileStorage = void 0; var create_cache_1 = require("./src/create-cache"); var key_file_storage_1 = require("./src/key-file-storage"); /** * Returns an instance of `key-file-storage` store to access the file system. * @param path The root storage path on the file system: * * For example `'./the/path/to/data'` * @param caching The selected cache configuration: * * `true` *(By default)* for unlimited cache, * * `false` to disable caching, * * `n: number` to cache the latest **n** accessed keys. */ function keyFileStorage(path, caching) { var cache = create_cache_1.default(caching); var store = key_file_storage_1.default(path, cache); return store; } exports.keyFileStorage = keyFileStorage; exports.default = keyFileStorage;