catbox-memory
Advanced tools
Comparing version 2.0.4 to 2.1.1
'use strict'; | ||
// Load modules | ||
const Hoek = require('hoek'); | ||
// Declare internals | ||
const internals = {}; | ||
@@ -18,6 +14,9 @@ | ||
// Provides a named reference for memory debugging | ||
internals.MemoryCacheSegment = function MemoryCacheSegment() { | ||
}; | ||
internals.MemoryCacheEntry = function MemoryCacheEntry(key, value, ttl, allowMixedContent) { | ||
@@ -28,3 +27,3 @@ | ||
if (allowMixedContent && Buffer.isBuffer(value)) { | ||
this.item = new Buffer(value.length); | ||
this.item = Buffer.alloc(value.length); | ||
// copy buffer to prevent value from changing while in the cache | ||
@@ -31,0 +30,0 @@ value.copy(this.item); |
{ | ||
"name": "catbox-memory", | ||
"description": "Memory adapter for catbox", | ||
"version": "2.0.4", | ||
"version": "2.1.1", | ||
"repository": "git://github.com/hapijs/catbox-memory", | ||
"engines": { | ||
"node": ">=6.0.0" | ||
}, | ||
"main": "lib/index.js", | ||
@@ -12,5 +15,2 @@ "keywords": [ | ||
], | ||
"engines": { | ||
"node": ">=4.0.0" | ||
}, | ||
"dependencies": { | ||
@@ -22,9 +22,9 @@ "hoek": "4.x.x" | ||
"code": "4.x.x", | ||
"lab": "11.x.x" | ||
"lab": "14.x.x" | ||
}, | ||
"scripts": { | ||
"test": "lab -a code -v -L -t 100", | ||
"test-cov-html": "lab -a code -r html -o coverage.html" | ||
"test": "lab -a code -L -t 100 -l", | ||
"test-cov-html": "lab -a code -r html -o coverage.html -l" | ||
}, | ||
"license": "BSD-3-Clause" | ||
"license": "SEE LICENSE IN LICENSE.md" | ||
} |
@@ -1,22 +0,9 @@ | ||
catbox-memory | ||
============= | ||
# catbox-memory | ||
Memory adapter for [catbox](https://github.com/hapijs/catbox). | ||
Lead Maintainer - [Wyatt Preul](https://github.com/geek) | ||
[![Build Status](https://travis-ci.org/hapijs/catbox-memory.svg?branch=v2-commercial)](https://travis-ci.org/hapijs/catbox-memory) | ||
Current version: [![Current Version](https://img.shields.io/npm/v/catbox-memory.svg)](https://www.npmjs.org/package/catbox-memory) [![Build Status](https://api.travis-ci.org/hapijs/catbox-memory.svg)](https://travis-ci.org/hapijs/catbox-memory) | ||
## License | ||
### Options | ||
- `maxByteSize` - sets an upper limit on the number of bytes that can be stored in the | ||
cache. Once this limit is reached no additional items will be added to the cache | ||
until some expire. The utilized memory calculation is a rough approximation and must | ||
not be relied on. Defaults to `104857600` (100MB). | ||
- `allowMixedContent` - by default, all data is cached as JSON strings, and converted | ||
to an object using `JSON.parse()` on retrieval. By setting this option to `true`, | ||
`Buffer` data can be stored alongside the stringified data. `Buffer`s are not | ||
stringified, and are copied before storage to prevent the value from changing while | ||
in the cache. Defaults to `false`. | ||
Note: the maximum allowed value for `ttl` is `2^31-1`, which is around 24.8 days. | ||
This version of the package requires a commercial license. You may not use, copy, or distribute it without first acquiring a commercial license from Sideway Inc. Using this software without a license is a violation of US and international law. To obtain a license, please contact [sales@sideway.com](mailto:sales@sideway.com). The open source version of this package can be found [here](https://github.com/hapijs/catbox-memory). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
7704
1
1
80
164
10
1