Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
fwsp-cacher
Advanced tools
Readme
A simple module for caching using Redis.
Cacher is a wrapper module to abstract cache details and handling in order to make it easier for clients to simply get and set cached data.
Cacher has five public functions: init
, setCachePrefix
, getData
, setData
and setTTL
. The most common methods you'll use after init
will be the getData
and setData
methods.
####init
Used to initialize a cacher object with an object containing the address, port and database number for use with Redis.
let cacher = new Cacher();
cacher.init({
url: '127.0.0.1',
port: 6379,
db: 1
});
By default Cacher prefix keys in Redis with the word cacher
. To specify an alternative prefix use the setCachePrefix member.
cacher.setCachePrefix('myAppName');
/**
* @name getData
* @summary Retrieve data from cache using key.
* @param {string} key - lookup key
* @return {object} promise - promise resolving to value of key or rejection
*/
getData(key)
/**
* @name setData
* @summary Place data in cache based on key for a duration of cacheDurationInSeconds.
* @param {string} key - lookup key
* @param {object} data - data to store at key
* @param {number} cacheDurationInSeconds - cache expiration
* @return {object} promise - resolving to success or rejection
*/
setData(key, data, cacheDurationInSeconds)
/**
* @name setTTL
* @summary Set Time To Live for cache entry associated with key.
* @param {string} key - key to set
* @param {number} cacheDurationInSeconds - seconds to reset expiration to
* @return {object} promise - resolving to success or rejection
*/
setTTL(key, cacheDurationInSeconds)
This module contains tests in the specs
folder.
To run them make sure you have mocha installed:
$ npm install mocha -g
Then run:
$ npm run test
FAQs
A caching module for use with Node and Redis
The npm package fwsp-cacher receives a total of 78 weekly downloads. As such, fwsp-cacher popularity was classified as not popular.
We found that fwsp-cacher 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.