Skip to content

Commit 2ab0521

Browse files
committed
README: Corrected promises example, see #51
1 parent c473690 commit 2ab0521

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ bcrypt.compare("not_bacon", hash, function(err, res) {
107107
// res === false
108108
});
109109

110-
//As of bcryptjs 2.4.0, compare returns a promise if callback is omitted.
111-
bcrypt.compare("B4c0/\/", hash)
112-
.then(() => {console.log("Comparison was true")}) //Will be called
113-
.catch(() => {console.log("Comparison was false")}) //Won't be called
110+
// As of bcryptjs 2.4.0, compare returns a promise if callback is omitted:
111+
bcrypt.compare("B4c0/\/", hash).then((res) => {
112+
// res === true
113+
});
114114
```
115115

116116
Auto-gen a salt and hash:

0 commit comments

Comments
 (0)