-
-
Notifications
You must be signed in to change notification settings - Fork 75
feat: update Node.js version matrix to include lts/* #641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9aa1372
feat(native): map `is-arrayish` to `Array.isArray`
dreyfus92 76034f1
feat: update Node.js version matrix to include lts/*
dreyfus92 72e52d3
feat(preferred): add `bcrypt` replacements and docs (#642)
dreyfus92 3377d84
feat: add `has-ansi` to replacements (#644)
gameroman e369087
feat: add `es6-set`, `es6-map`, and `es6-error` (#637)
dreyfus92 bb733b7
feat(preferred): add `wrap-ansi` replacement to `fast-wrap-ansi` (#638)
dreyfus92 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| --- | ||
| description: Modern alternatives to the bcrypt package for password hashing | ||
| --- | ||
|
|
||
| # Replacements for `bcrypt` | ||
|
|
||
| The `bcrypt` package can be replaced by native functionality in most runtimes, or more performant packages. | ||
|
|
||
| ## `bcryptjs` | ||
|
|
||
| [`bcryptjs`](https://github.com/dcodeIO/bcrypt.js) is a widely used pure JavaScript implementation with a very similar API surface to `bcrypt`. | ||
|
|
||
| ```ts | ||
| import bcrypt from 'bcrypt' // [!code --] | ||
| import bcrypt from 'bcryptjs' // [!code ++] | ||
|
|
||
| const salt = await bcrypt.genSalt(10) | ||
|
|
||
| const hash = await bcrypt.hash('password', salt) | ||
| ``` | ||
|
|
||
| ## `node:crypto` (native, Node.js built-in) | ||
|
|
||
| Node provides [`node:crypto`](https://nodejs.org/api/crypto.html) for secure password hashing primitives (for example `scrypt` and `pbkdf2`). This is not a drop-in `bcrypt` API replacement, but is a good option if you can switch to a more secure cryptographic algorithm it supports. | ||
|
|
||
| ## Web Crypto API (native) | ||
|
|
||
| The [Web Crypto API](https://developer.mozilla.org/docs/Web/API/Web_Crypto_API) provides native functionality for cryptographic operations in both web browsers and Node. | ||
|
|
||
| > [!NOTE] | ||
| > A few legacy algorithms are intentionally omitted for security reasons (e.g. MD5). | ||
|
|
||
| ## Bun (built-in) | ||
|
|
||
| Bun supports the Web Crypto API natively, and also provides support for streaming hashing via [`Bun.CryptoHasher`](https://bun.sh/docs/api/hashing). | ||
|
|
||
| As with the Web Crypto API, many legacy algorithms are intentionally omitted for security reasons (e.g. MD5). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| description: Modern replacement for the wrap-ansi package for wrapping terminal strings (including ANSI-colored output) | ||
| --- | ||
|
|
||
| # Replacements for `wrap-ansi` | ||
|
|
||
| ## `fast-wrap-ansi` | ||
|
|
||
| [`fast-wrap-ansi`](https://github.com/43081j/fast-wrap-ansi) is a drop‑in replacement for `wrap-ansi` that’s faster and smaller. | ||
|
|
||
| ```ts | ||
| import wrapAnsi from 'wrap-ansi' // [!code --] | ||
| import wrapAnsi from 'fast-wrap-ansi' // [!code ++] | ||
|
|
||
| const value = '\u001B[36mhello-super-long-token-without-spaces\u001B[39m' | ||
|
|
||
| console.log(wrapAnsi(value, 12, { hard: true, trim: false })) | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
presumably lts currently includes 20?
we don't really want to remove the explicit
20.xthough as that'd mean our tested versions is a moving window.it may be better to specify 25 directly 🤔