diff --git a/index.js b/index.js index 4c3ea36..565a4f3 100644 --- a/index.js +++ b/index.js @@ -25,7 +25,12 @@ function D (cons, opts) { if (opts.weak !== false && !opts.proto) { if (!weak) { - weak = require("weak-napi") + if (parseInt(process.version.substr(1)) < 6) { + weak = require("weak") + } + else { + weak = require("weak-napi") + } } opts.proto = {};