Release notes
*Sourced from [node-cache's releases](https://github.com/mpneuried/nodecache/releases).*
> ## Add .take() and .flushStats()
> * Add .take(key) method to get and delete a key with a single operation. [#159](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/159) [#160](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/160)
> * Add .flushStats() method to reset all cache stats back to 0. [#158](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/158) [#161](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/161)
>
> ## Fix deleteOnExpire: false
> * Fixed bug where expired values were deleted even though deleteOnExpire was set to false. Thanks to [fielding-wilson](https://github.com/fielding-wilson) for [#154](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/154)!
>
> ## Fix null values
> * Fixed bug where users could not set null values. Thanks to [StefanoSega](https://github.com/StefanoSega), [jwest23](https://github.com/jwest23) and [marudor](https://github.com/marudor)! [#151](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/151) [#152](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/152)
>
> ## Drop lodash dependency and callbacks
> * Remove lodash dependency
> * **DROP CALLBACK SUPPORT** - Read the migration guide if you are currently using the callback based api! :warning:
> * add .has(key) and method - Thanks to Regev Brody for PR [#132](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/132)!
> * add .mset([{key,val,ttl}]) method - Thanks to Sujesh Thekkepatt for PR [#142](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/142)!
> * add maxKeys setting to limit cache size - Thanks do [@daluf](https://github.com/daluf) for PR [#141](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/141)!
> * Also, thank you to all other contributors that remain unnamed here! :tada:
>
> ---
>
> ## MIGRATION GUIDE :construction:
>
> We have dropped callback support in node-cache and you should migrate to our sync-style api!
>
> **If you cannot refactor right now**, you can **turn on legacy callback support** by enabling the `enableLegacyCallbacks` option. Eg: `const cache = new NodeCache({ enableLegacyCallbacks: true })`
>
> But we **strongly recommend to refactor your code to use the sync-api** because we will drop official callback support in Versions v6.x and onwards.
>
> If your code currently looks like this:
>
> ```javascript
> cache.get("my-key", function(err, value) {
> if (err) {
> // ...
> }
>
> // double equal checks for null and undefined
> if (value != null) {
> // hmm.... nothing here :(
> }
>
> // do something with value
> });
> ```
>
> it should be rewritten to:
>
> ```javascript
> const value = cache.get("my-key");
>
> ... (truncated)
Commits
- [`81fa811`](https://github.com/node-cache/node-cache/commit/81fa811182ad6c5735b7e0a26dd024c7e21f145b) 5.1.0
- [`d1deead`](https://github.com/node-cache/node-cache/commit/d1deead7a2e108dbe24092a469010711cdcaa6d7) changelog for v5.1.0
- [`ee87747`](https://github.com/node-cache/node-cache/commit/ee8774734e294db6790419a69ab104d924fe0a4c) add readme docs for .take() method from [#159](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/159) [#160](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/160)
- [`a30343a`](https://github.com/node-cache/node-cache/commit/a30343a6546e5509e2c9099707e387fae94c7738) optimize inline docs for .flushStats(), resolves [#161](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/161)
- [`66cb56a`](https://github.com/node-cache/node-cache/commit/66cb56ac4ffae6975b3998b3485b7a47eb614a5e) Merge pull request [#161](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/161) from sujeshthekkepatt/feat/flushstats
- [`0f93de6`](https://github.com/node-cache/node-cache/commit/0f93de6afd1f58a4a8dd5b4fb052bb97db51bc01) feat(flush stats): flush stats method
- [`f0a8860`](https://github.com/node-cache/node-cache/commit/f0a8860a4c1b547b048ffe1ed6556f335fb5dd46) Merge pull request [#160](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/160) from KrishnaPG/master
- [`640fa54`](https://github.com/node-cache/node-cache/commit/640fa54127da680054aaf9957537af87da1e7b96) fix(take): fixes the falsy values bug
- [`5248736`](https://github.com/node-cache/node-cache/commit/5248736caad8788c4e5a41cdf12bba0752c16199) chore: reverting to master version
- [`7c3be0d`](https://github.com/node-cache/node-cache/commit/7c3be0d8fd7d45870755676077b794e784fc9785) feat(take): Added take() method for single-use values
- Additional commits viewable in [compare view](https://github.com/mpneuried/nodecache/compare/4.2.1...v5.1.0)
Maintainer changes
This version was pushed to npm by [erdii](https://www.npmjs.com/~erdii), a new releaser for node-cache since your current version.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
Bumps node-cache from 4.2.1 to 5.1.0.
Release notes
*Sourced from [node-cache's releases](https://github.com/mpneuried/nodecache/releases).* > ## Add .take() and .flushStats() > * Add .take(key) method to get and delete a key with a single operation. [#159](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/159) [#160](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/160) > * Add .flushStats() method to reset all cache stats back to 0. [#158](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/158) [#161](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/161) > > ## Fix deleteOnExpire: false > * Fixed bug where expired values were deleted even though deleteOnExpire was set to false. Thanks to [fielding-wilson](https://github.com/fielding-wilson) for [#154](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/154)! > > ## Fix null values > * Fixed bug where users could not set null values. Thanks to [StefanoSega](https://github.com/StefanoSega), [jwest23](https://github.com/jwest23) and [marudor](https://github.com/marudor)! [#151](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/151) [#152](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/152) > > ## Drop lodash dependency and callbacks > * Remove lodash dependency > * **DROP CALLBACK SUPPORT** - Read the migration guide if you are currently using the callback based api! :warning: > * add .has(key) and method - Thanks to Regev Brody for PR [#132](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/132)! > * add .mset([{key,val,ttl}]) method - Thanks to Sujesh Thekkepatt for PR [#142](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/142)! > * add maxKeys setting to limit cache size - Thanks do [@daluf](https://github.com/daluf) for PR [#141](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/141)! > * Also, thank you to all other contributors that remain unnamed here! :tada: > > --- > > ## MIGRATION GUIDE :construction: > > We have dropped callback support in node-cache and you should migrate to our sync-style api! > > **If you cannot refactor right now**, you can **turn on legacy callback support** by enabling the `enableLegacyCallbacks` option. Eg: `const cache = new NodeCache({ enableLegacyCallbacks: true })` > > But we **strongly recommend to refactor your code to use the sync-api** because we will drop official callback support in Versions v6.x and onwards. > > If your code currently looks like this: > > ```javascript > cache.get("my-key", function(err, value) { > if (err) { > // ... > } > > // double equal checks for null and undefined > if (value != null) { > // hmm.... nothing here :( > } > > // do something with value > }); > ``` > > it should be rewritten to: > > ```javascript > const value = cache.get("my-key"); > > ... (truncated)Commits
- [`81fa811`](https://github.com/node-cache/node-cache/commit/81fa811182ad6c5735b7e0a26dd024c7e21f145b) 5.1.0 - [`d1deead`](https://github.com/node-cache/node-cache/commit/d1deead7a2e108dbe24092a469010711cdcaa6d7) changelog for v5.1.0 - [`ee87747`](https://github.com/node-cache/node-cache/commit/ee8774734e294db6790419a69ab104d924fe0a4c) add readme docs for .take() method from [#159](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/159) [#160](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/160) - [`a30343a`](https://github.com/node-cache/node-cache/commit/a30343a6546e5509e2c9099707e387fae94c7738) optimize inline docs for .flushStats(), resolves [#161](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/161) - [`66cb56a`](https://github.com/node-cache/node-cache/commit/66cb56ac4ffae6975b3998b3485b7a47eb614a5e) Merge pull request [#161](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/161) from sujeshthekkepatt/feat/flushstats - [`0f93de6`](https://github.com/node-cache/node-cache/commit/0f93de6afd1f58a4a8dd5b4fb052bb97db51bc01) feat(flush stats): flush stats method - [`f0a8860`](https://github.com/node-cache/node-cache/commit/f0a8860a4c1b547b048ffe1ed6556f335fb5dd46) Merge pull request [#160](https://github-redirect.dependabot.com/mpneuried/nodecache/issues/160) from KrishnaPG/master - [`640fa54`](https://github.com/node-cache/node-cache/commit/640fa54127da680054aaf9957537af87da1e7b96) fix(take): fixes the falsy values bug - [`5248736`](https://github.com/node-cache/node-cache/commit/5248736caad8788c4e5a41cdf12bba0752c16199) chore: reverting to master version - [`7c3be0d`](https://github.com/node-cache/node-cache/commit/7c3be0d8fd7d45870755676077b794e784fc9785) feat(take): Added take() method for single-use values - Additional commits viewable in [compare view](https://github.com/mpneuried/nodecache/compare/4.2.1...v5.1.0)Maintainer changes
This version was pushed to npm by [erdii](https://www.npmjs.com/~erdii), a new releaser for node-cache since your current version.Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired)