+4
-2
@@ -902,4 +902,5 @@ "use strict"; | ||
| async getOrSet(key, function_, options) { | ||
| const getOptions = options?.nonBlocking === void 0 ? void 0 : { nonBlocking: options.nonBlocking }; | ||
| const cacheAdapter = { | ||
| get: async (key2) => this.get(key2), | ||
| get: async (key2) => this.get(key2, getOptions), | ||
| /* v8 ignore next -- @preserve */ | ||
@@ -921,3 +922,4 @@ has: async (key2) => this.has(key2), | ||
| cacheErrors: options?.cacheErrors, | ||
| throwErrors: options?.throwErrors | ||
| throwErrors: options?.throwErrors, | ||
| nonBlocking: options?.nonBlocking | ||
| }; | ||
@@ -924,0 +926,0 @@ return (0, import_utils.getOrSet)(key, function_, getOrSetOptions); |
+4
-2
@@ -887,4 +887,5 @@ // src/index.ts | ||
| async getOrSet(key, function_, options) { | ||
| const getOptions = options?.nonBlocking === void 0 ? void 0 : { nonBlocking: options.nonBlocking }; | ||
| const cacheAdapter = { | ||
| get: async (key2) => this.get(key2), | ||
| get: async (key2) => this.get(key2, getOptions), | ||
| /* v8 ignore next -- @preserve */ | ||
@@ -906,3 +907,4 @@ has: async (key2) => this.has(key2), | ||
| cacheErrors: options?.cacheErrors, | ||
| throwErrors: options?.throwErrors | ||
| throwErrors: options?.throwErrors, | ||
| nonBlocking: options?.nonBlocking | ||
| }; | ||
@@ -909,0 +911,0 @@ return getOrSet(key, function_, getOrSetOptions); |
+6
-9
| { | ||
| "name": "cacheable", | ||
| "version": "2.3.2", | ||
| "version": "2.3.3", | ||
| "description": "High Performance Layer 1 / Layer 2 Caching with Keyv Storage", | ||
@@ -30,3 +30,2 @@ "type": "module", | ||
| "devDependencies": { | ||
| "@biomejs/biome": "^2.3.11", | ||
| "@faker-js/faker": "^10.2.0", | ||
@@ -36,16 +35,14 @@ "@keyv/redis": "^5.1.5", | ||
| "@qified/redis": "^0.6.0", | ||
| "@types/node": "^25.0.8", | ||
| "@vitest/coverage-v8": "^4.0.17", | ||
| "@types/node": "^24.10.10", | ||
| "lru-cache": "^11.2.4", | ||
| "rimraf": "^6.1.2", | ||
| "tsup": "^8.5.1", | ||
| "typescript": "^5.9.3", | ||
| "vitest": "^4.0.17" | ||
| "typescript": "^5.9.3" | ||
| }, | ||
| "dependencies": { | ||
| "hookified": "^1.15.0", | ||
| "keyv": "^5.5.5", | ||
| "keyv": "^5.6.0", | ||
| "qified": "^0.6.0", | ||
| "@cacheable/memory": "^2.0.7", | ||
| "@cacheable/utils": "^2.3.3" | ||
| "@cacheable/memory": "^2.0.8", | ||
| "@cacheable/utils": "^2.4.0" | ||
| }, | ||
@@ -52,0 +49,0 @@ "keywords": [ |
+4
-1
@@ -5,3 +5,3 @@ [<img align="center" src="https://cacheable.org/logo.svg" alt="Cacheable" />](https://github.com/jaredwray/cacheable) | ||
| [](https://codecov.io/gh/jaredwray/cacheable) | ||
| [](https://codecov.io/gh/jaredwray/cacheable) | ||
| [](https://github.com/jaredwray/cacheable/actions/workflows/tests.yml) | ||
@@ -797,5 +797,8 @@ [](https://www.npmjs.com/package/cacheable) | ||
| throwErrors?: boolean; | ||
| nonBlocking?: boolean; | ||
| }; | ||
| ``` | ||
| The `nonBlocking` option allows you to override the instance-level `nonBlocking` setting for the `get` call within `getOrSet`. When set to `false`, the `get` will block and wait for a response from the secondary store before deciding whether to call the provided function. When set to `true`, the primary store returns immediately and syncs from secondary in the background. | ||
| Here is an example of how to use the `getOrSet` method: | ||
@@ -802,0 +805,0 @@ |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
166505
0.38%9
-25%2759
0.15%846
0.36%Updated
Updated
Updated