Skip to content

Commit

Permalink
Change binding resolution to mitigate "Module parse failed" errors (#366
Browse files Browse the repository at this point in the history
)

* Change binding resolution to use the recommended option from @mapbox/node-pre-gyp

Fixes #365 

Co-authored-by: Ranieri Althoff <[email protected]>
  • Loading branch information
Voltra and ranisalt authored Dec 27, 2022
1 parent e324b57 commit 3b0914f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion argon2.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"use strict";
const assert = require("assert");
const { randomBytes, timingSafeEqual } = require("crypto");
const path = require("path");
const { promisify } = require("util");
const binary = require("@mapbox/node-pre-gyp");

const { hash: _hash } = require("./lib/binding/napi-v3/argon2.node");
const bindingPath = binary.find(path.resolve(__dirname, "./package.json"));
const { hash: _hash } = require(bindingPath);

const { deserialize, serialize } = require("@phc/format");

Expand Down

0 comments on commit 3b0914f

Please sign in to comment.