node.bcrypt.js icon indicating copy to clipboard operation
node.bcrypt.js copied to clipboard

please support usage with import, not just require

Open mariusa opened this issue 4 years ago • 3 comments

README mentions usage only with require As some projects are moving to using import instead, would you please support usage with import as well, for node 16.x?

mariusa avatar Sep 14 '21 04:09 mariusa

Should the import does not work with the CommonJS interop already?

recrsn avatar Sep 14 '21 06:09 recrsn

Could you please add to README how to use import?

mariusa avatar Sep 14 '21 10:09 mariusa

Works fine for me with import:

import bcrypt from "bcrypt";

// later
await bcrypt.compare(password, hash);

perry-mitchell avatar Nov 05 '21 09:11 perry-mitchell