Skip to content

Commit

Permalink
Add note on using the ESM variant in the browser
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Feb 13, 2025
1 parent 58333a1 commit e09eb9a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import bcrypt from "bcryptjs";

Replace `TAG` respectively `VERSION` with a [specific version](https://github.com/dcodeIO/bcrypt.js/releases) or omit it (not recommended in production) to use latest.

When using the ESM variant in a browser, the `crypto` import needs to be stubbed out, for example using an [import map](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap). Bundlers should omit it automatically.

### Usage - Sync

To hash a password:
Expand Down

0 comments on commit e09eb9a

Please sign in to comment.