New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

memcache-client-memoizer

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memcache-client-memoizer - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

11

package.json
{
"name": "memcache-client-memoizer",
"version": "0.0.1",
"version": "0.0.2",
"description": "Memoizes promise-returning functions via memcache-client",

@@ -34,4 +34,11 @@ "main": "index.js",

"standard": {
"globals": [ "jest", "beforeEach", "afterEach", "describe", "it", "expect" ]
"globals": [
"jest",
"beforeEach",
"afterEach",
"describe",
"it",
"expect"
]
}
}

18

README.md

@@ -18,6 +18,3 @@ ## memcache-client-memoizer

## Note:
Rejected promises and callbacks called with an `err` argument are not memoized, since that's a pretty bad idea :)
## Promise Memoization
## API
`memoizer(options)`

@@ -29,8 +26,11 @@

* `fn`: `Function`. Required. The function to memoize, must return a Promise.
* `keyFn`: `(args to fn) => 'key-string'`. Required. A function which returns a string cache-key for memcached. This
function is called with the same arguments as `fn`, allowing you to create a dynamic cache-key, for example:
```javascript
const exampleKeyFn = ({ name, color }) => `${name}:${color}`
```
* `keyFn`: `(args to fn) => 'key-string'`. Required. A function which returns a string cache-key for memcached. This function is called with the same arguments as `fn`, allowing you to create a dynamic cache-key, for example:
```javascript
const exampleKeyFn = ({ name, color }) => `${name}:${color}`
```
* `setOptions`: `object`. Optional. `memcached-client` [command options](https://www.npmjs.com/package/memcache-client#command-options).
### Note:
Rejected promises and callbacks called with an `err` argument are not memoized, since that's a pretty bad idea :)
### Example:

@@ -37,0 +37,0 @@ ```javascript

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc