Skip to content

Commit 62e55ff

Browse files
FNDmoonglum
authored andcommitted
dropped support for Node v6
April 2019 marks the end of life for this LTS version, so it should soon be phased out by users retaining `promisify` for now to avoid breaking changes (even though downstream libraries would only need to change the respective import path - assuming our implementation is in fact compatible with Node's)
1 parent a758e25 commit 62e55ff

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
language: node_js
22
node_js:
3-
- 6
43
- 8
54
- 10
65

lib/util/index.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
let path = require("path");
44
let crypto = require("crypto");
5+
let { promisify } = require("util");
56

67
exports.abort = abort;
8+
exports.promisify = promisify; // deprecated
79
exports.repr = repr;
810

911
// reports success or failure for a given file path (typically regarding
@@ -34,20 +36,6 @@ exports.generateFingerprint = (filepath, data) => {
3436
return path.join(path.dirname(filepath), `${name}-${hash}${ext}`);
3537
};
3638

37-
// simplistic imitation of Node 8's `util.promisify`
38-
// NB: only supports a single callback parameter
39-
exports.promisify = fn => {
40-
return (...args) => new Promise((resolve, reject) => {
41-
fn(...args, (err, res) => {
42-
if(err) {
43-
reject(err);
44-
return;
45-
}
46-
resolve(res);
47-
});
48-
});
49-
};
50-
5139
function abort(msg, code = 1) {
5240
console.error(msg);
5341
process.exit(code);

0 commit comments

Comments
 (0)