Last active
July 27, 2016 18:39
-
-
Save bhague1281/fe24346dd5a33099933f65653b0875f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const NodeCache = require('node-cache'); | |
const cache = new NodeCache(); | |
let data = { results: [] }; | |
// using the cache module to add an object to the cache | |
cache.set('my-pokemon', data, (err, success) => { | |
// success will be true if successful | |
}); | |
// using the cache module to retrieve an object from the cache | |
cache.get('my-pokemon', (err, data) => { | |
// data will be the object from the cache, if it exists | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment