kelektiv / node.bcrypt.js

bcrypt for NodeJs
MIT License
7.43k stars 510 forks source link

please support usage with import, not just require #892

Closed mariusa closed 1 year ago

mariusa commented 2 years ago

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?

recrsn commented 2 years ago

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

mariusa commented 2 years ago

Could you please add to README how to use import?

perry-mitchell commented 2 years ago

Works fine for me with import:

import bcrypt from "bcrypt";

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