diff --git a/.travis.yml b/.travis.yml index 0596dd1..0b4d861 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,7 @@ node_js: - "5" - "4" - "0.12" - - "0.10" matrix: fast_finish: true allow_failures: - - node_js: "0.10" - node_js: "0.12" diff --git a/lib/consolidate.js b/lib/consolidate.js index 8a06431..d8f9e33 100644 --- a/lib/consolidate.js +++ b/lib/consolidate.js @@ -16,7 +16,7 @@ var fs = require('fs'); var path = require('path'); -var Promise = require('bluebird'); +var utilPromisify = require('util.promisify'); var join = path.join; var resolve = path.resolve; @@ -134,15 +134,11 @@ function readPartials(path, options, fn) { * promisify */ function promisify(fn, exec) { - return new Promise(function (res, rej) { - fn = fn || function (err, html) { - if (err) { - return rej(err); - } - res(html); - }; + if (fn) { exec(fn); - }); + } else { + return utilPromisify(exec)(); + } } @@ -1364,7 +1360,7 @@ exports['arc-templates'] = fromStringRenderer('arc-templates'); */ exports['arc-templates'].render = function(str, options, fn) { - var readFileWithOptions = Promise.promisify(read); + var readFileWithOptions = utilPromisify(read); var consolidateFileSystem = {}; consolidateFileSystem.readFile = function (path) { return readFileWithOptions(path, options); diff --git a/package.json b/package.json index 97989a9..1e19aab 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "version": "0.14.5", "author": "TJ Holowaychuk ", "dependencies": { - "bluebird": "^3.1.1" + "util.promisify": "^1.0.0" }, "devDependencies": { "arc-templates": "^0.5.1",