diff --git a/index.js b/index.js index 28c79cd..64c1401 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ const Cache = require('cache-point') const DmdOptions = require('./lib/dmd-options') const dmdVersion = require('./package').version const FileSet = require('file-set') +const os = require('os') /** * Transforms doclet data into markdown documentation. @@ -17,7 +18,8 @@ async function dmd (templateData, options) { return generate(templateData, options) } else { try { - return dmd.cache.read([templateData, options, dmdVersion]) + const result = await dmd.cache.read([templateData, options, dmdVersion]) + return result } catch (err) { /* cache miss */ return generate(templateData, options) @@ -25,7 +27,7 @@ async function dmd (templateData, options) { } } -dmd.cache = new Cache({ dir: path.join(require('os').tmpdir(), 'dmd') }) +dmd.cache = new Cache({ dir: path.join(os.tmpdir(), 'dmd') }) async function generate (templateData, options) { const fs = require('fs') diff --git a/test/ddata/children.js b/test/ddata/children.js index 557b2af..219f519 100644 --- a/test/ddata/children.js +++ b/test/ddata/children.js @@ -27,4 +27,3 @@ test.set('_children', function () { }) module.exports = { test, only, skip } -