如何在node.js中获取一个进程模块缓存?

时间:2016-12-07 06:38:36

标签: node.js process

我运行了一个node.js进程,模块缓存在哪里? 如何获得此进程的模块缓存?

1 个答案:

答案 0 :(得分:0)

    if you have to store values in cache then node-redis module is best for you. 
Redis is a fast and efficient in-memory key-value store. It is also known as a data structure server, as the keys can contain strings, lists, sets, hashes and other data structures. 

var redis = require('redis');
var client = redis.createClient(); 
client.on('connect', function() {
    console.log('connected');
});
client.set('framework', 'AngularJS', function(err, reply) {
  console.log(reply);
});
client.get('framework', function(err, reply) {
    console.log(reply);
});
相关问题