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

cachemon

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cachemon

A utiltiy for implementing redis based data caching and querying

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

Modules

Cachemon

Classes

CacheMonClientEventEmitter

const cnrCache = new CacheMonClient({ name: 'DATA', executeCronJob: false, cronPeriod: '0 *', cronExecutorFn: (done) => { i++; console.log('Running'); request({ url: 'https://api.github.com/users/rajatady/repos?per_page=10', headers: { 'User-Agent': 'request' } }, (err, response, body) => { if (err) { done(); } else { cnrCache.updateResourcePool(body) .then(res => { console.log('Done'); }) .catch(err => { console.log(err); }) } }); }, requestMethod: 'GET', urlDomain: '/data' });

cnrCache.on('updated', (data) => { console.log('Updated'); });

export default resource(cnrCache);

Constants

exports.initializePromise.<any>
exports.resourceCacheMonClient
exports.hasKey ⇒ ⏏
exports.cacheMiddlewarefunction
exports.getResource*

Functions

generateHash(str)* | PromiseLike.<ArrayBuffer>
setData(key, value)Promise.<any>

Set some data in the resource. The key will be prefixed with the resource name specified earlier

getData(key)Promise.<any>

Get some data from the resource. The key will be prefixed with the resource name specified earlier

setResourcePool(resourcePoolData)Promise.<any>

Sets the data in the resource pool

getResourcePool()Promise.<any>

Get the data from the resource pool

appendToResourcePool(appendData)Promise.<any>
updateResourcePool(updateData)Promise.<any>
runCronJob()
invalidateResourcePool()Promise.<any>

Cachemon

exports.initialize ⇒ Promise.<any>

Kind: global constant of Cachemon

Param
config

exports.resource ⇒ CacheMonClient

Kind: global constant of Cachemon

Param
clientConfig

exports.hasKey ⇒ ⏏

Kind: global constant of Cachemon
Returns: Promise

ParamType
url
cacheModelCacheMonClient

exports.cacheMiddleware ⇒ function

Kind: global constant of Cachemon

ParamType
cacheModelCacheMonClient

exports.getResource ⇒ *

Kind: global constant of Cachemon

Param
resourceName

generateHash(str) ⇒ * | PromiseLike.<ArrayBuffer>

Kind: global method of Cachemon

Param
str

CacheMonClient ⇐ EventEmitter

const cnrCache = new CacheMonClient({ name: 'DATA', executeCronJob: false, cronPeriod: '0 * * * * *', cronExecutorFn: (done) => { i++; console.log('Running'); request({ url: 'https://api.github.com/users/rajatady/repos?per_page=10', headers: { 'User-Agent': 'request' } }, (err, response, body) => { if (err) { done(); } else { cnrCache.updateResourcePool(body) .then(res => { console.log('Done'); }) .catch(err => { console.log(err); }) } }); }, requestMethod: 'GET', urlDomain: '/data' });

cnrCache.on('updated', (data) => { console.log('Updated'); });

export default resource(cnrCache);

Kind: global class
Extends: EventEmitter

setData(key, value) ⇒ Promise.<any>

Set some data in the resource. The key will be prefixed with the resource name specified earlier

Kind: global function

ParamTypeDescription
keyStringThe key to be put in the cache
valueStringThe data to be saved

getData(key) ⇒ Promise.<any>

Get some data from the resource. The key will be prefixed with the resource name specified earlier

Kind: global function

ParamTypeDescription
keyStringThe key to fetch from the cache

setResourcePool(resourcePoolData) ⇒ Promise.<any>

Sets the data in the resource pool

Kind: global function

ParamTypeDescription
resourcePoolDataStringSet the data in the resource pool

getResourcePool() ⇒ Promise.<any>

Get the data from the resource pool

Kind: global function

appendToResourcePool(appendData) ⇒ Promise.<any>

Kind: global function

Param
appendData

updateResourcePool(updateData) ⇒ Promise.<any>

Kind: global function

Param
updateData

runCronJob()

Kind: global function

invalidateResourcePool() ⇒ Promise.<any>

Kind: global function

Keywords

FAQs

Package last updated on 18 Apr 2018

Did you know?

Socket

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.

Install

Related posts

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