Comparing version 0.0.5 to 0.0.6
@@ -6,5 +6,7 @@ var cache = module.exports; | ||
var writeFileAsync = Promise.promisify(fs.writeFile); | ||
var os = require('os'); | ||
var join = require('path').join; | ||
cache.data = {}; | ||
cache.source = __dirname + '/../.cache.json'; | ||
cache.source = join(os.tmpdir(), 'libesvm.cache.json'); | ||
@@ -16,3 +18,3 @@ /** | ||
* @param {function} cb The node style callback | ||
* @returns {Promise} | ||
* @returns {Promise} | ||
*/ | ||
@@ -22,3 +24,3 @@ var set = cache.set = function (key, value, cb) { | ||
.then(function () { | ||
cache.data[key] = value; | ||
cache.data[key] = value; | ||
}) | ||
@@ -40,3 +42,3 @@ .then(function () { | ||
.then(function () { | ||
return cache.data[key]; | ||
return cache.data[key]; | ||
}) | ||
@@ -48,3 +50,3 @@ .nodeify(cb); | ||
* Fetches the data from the file | ||
* @param {function} cb The node style callback | ||
* @param {function} cb The node style callback | ||
* @returns {Promise} | ||
@@ -55,3 +57,3 @@ */ | ||
.then(function (buffer) { | ||
cache.data = JSON.parse(buffer.toString('utf8')); | ||
cache.data = JSON.parse(buffer.toString('utf8')); | ||
return cache.data; | ||
@@ -63,3 +65,3 @@ }) | ||
return cache.data; | ||
} | ||
} | ||
}) | ||
@@ -66,0 +68,0 @@ .nodeify(cb); |
{ | ||
"name": "libesvm", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "libesvm is a library for managning an Elasticsearch process for development and testing.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
36809
968