Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A scoped, fluent API for easily interacting with hierarchical, key-value data
Cachetree provides a scoped, fluent API for easily interacting with hierarchical, key-value data. Cachetree was developed to provide an API for hierarchical data caching (hence the name), but can be used to interact with any hash data that can be organized into a tree-like structure.
npm install cachetree
The original implementation of Cachtree has a single storage backend, Redis, and was designed to provide a wrapper API around Redis hashes. Redis hashes are simply key-value collections, accessible by a key
. Within a Redis hash, an individual value is accessible by its key, which is referred to a field
. The current implementation of Cachetree has been refactored to allow for pluggable storage backends, but the language still mirrors its Redis-specific ancestry.
The following storage backends are available:
MemoryStore
)cachetree-redis
module)Storage backends extend EventEmitter and expose the following functions:
get(key, field, [field …], cb)
: Get the values of all the given hash fieldsset(key, field, value, [field, value …], cb)
: Set the values of given hash fieldskeys(pattern, cb)
: Find all keys matching the given patternexists(key, field, cb)
: Determine if a hash field existsdel(key, field, [field …], cb)
: Delete one or more hash fieldsflush(key, [key …], cb)
: Delete one or more hashesTo create a new Cachetree instance:
var cachetree = require('cachetree'),
cache = cachetree();
The Cachetree module export a single contstructor function that accepts two optional arguments and returns a Cachtree instance.
cachetree(store, key, useProperties)
store
: Storage backend instancekey
: Root cache key, defaults to cache
options
: An object containing the following configuration options:
useProperties
: Use properties (and not functions) for explicit scope, defaults to false
Cachetree tests require Mocha and can be run with either npm test
or make test
. You can specify Mocha options, such as the reporter, by adding a mocha.opts file, which is ignored by git, to the test
directory.
FAQs
A scoped, fluent API for easily interacting with hierarchical, key-value data
We found that cachetree demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.