You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: transported docs from e18e; slight stylistic cleanup (#258)
* a
* extra
* core-util-us + update index
* make shell stuff a bit more distinguishable
* fix diffs for chalk page
* extra space
* bash
* remote html comment
noway i did this with a regex find and replace
* :/
* add description frontmatter for lodash-underscore doc
* remove all the info from lodash doc to match the style
* ts -> diff codeblock
* Update js-yaml.md
* thank you james
* js -> ts
* tson -> json
* remove process-exec (old file)
* change docPaths & sort manifests
* Update docs/modules/globby.md
Co-authored-by: James Garbutt <43081j@users.noreply.github.com>
* Update find-up.md
* Update find-up.md
* Update docs/modules/tempy.md
Co-authored-by: James Garbutt <43081j@users.noreply.github.com>
* Update docs/modules/tempy.md
Co-authored-by: James Garbutt <43081j@users.noreply.github.com>
---------
Co-authored-by: James Garbutt <43081j@users.noreply.github.com>
description: Modern alternatives to the axios package for making HTTP requests in browsers and Node.js
3
+
---
2
4
3
-
`axios` is a popular HTTP client library, but modern JavaScript and Node.js provide native alternatives that can often replace it for many use cases.
4
-
5
-
# Alternatives
5
+
# Replacements for `axios`
6
6
7
7
## Native `fetch` API
8
8
9
-
The native `fetch` API is now available in Node.js (since v18.x) and all modern browsers. For most HTTP requests, it can replace axios without additional dependencies.
9
+
The native [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) API is available in Node.js (since v18.x) and all modern browsers. For most HTTP requests, it can replace `axios` without extra dependencies.
[`ky`](https://github.com/sindresorhus/ky) is a lightweight HTTP client based on the Fetch API with timeout support, hooks (interceptors) and other helpers.
27
29
28
-
## ky
30
+
Example:
29
31
30
-
`ky` is a tiny and elegant HTTP client based on the Fetch API. It provides a more convenient API than raw fetch while being much smaller than axios. Also, includes `hooks` (interceptors) for request/response modification.
description: Modern alternatives to the Bluebird and Q Promise libraries for async control flow in JavaScript
3
+
---
2
4
3
-
[`bluebird`](https://github.com/petkaantonov/bluebird?tab=readme-ov-file#%EF%B8%8Fnote%EF%B8%8F) and [`q`](https://github.com/kriskowal/q#note) recommends that you switch away from them to native promises.
5
+
# Replacements for `bluebird` / `q`
4
6
5
-
#Alternatives
7
+
## `Promise` (native)
6
8
7
-
## Native JavaScript `Promise`
8
-
9
-
For most cases, native JavaScript `Promise` is enough.
[`bluebird`](https://github.com/petkaantonov/bluebird?tab=readme-ov-file#%EF%B8%8Fnote%EF%B8%8F) and [`q`](https://github.com/kriskowal/q#note) recommend switching away from them to native promises.
12
10
13
11
## NativeBird
14
12
15
-
Ultralight native `Promise` extension compatible with `bluebird` if you need some helpers missed in native JavaScript `Promise`.
[`NativeBird`](https://github.com/doodlewind/nativebird) is an ultralight native `Promise` extension that provides Bluebird-like helpers if you miss a few conveniences from Bluebird.
description: Modern alternatives to the body-parser package for parsing HTTP request bodies in Node.js servers
3
+
---
2
4
3
-
`body-parser` can be replaced with more modern alternatives which are both lighter and faster.
5
+
# Replacements for `body-parser`
4
6
5
-
#Alternatives
7
+
## `milliparsec`
6
8
7
-
## Native Implementation
9
+
[`milliparsec`](https://github.com/tinyhttp/milliparsec) is a lightweight alternative to [`body-parser`](https://github.com/expressjs/body-parser) with a smaller footprint.
8
10
9
-
For simple use cases, you can implement a minimal body parser in vanilla JavaScript:
11
+
Example:
10
12
11
-
```js
12
-
constsizeLimit=10*1024; // limit body size to 10kB
Do note that the above implementation lacks sophisticated features such as better error handling, timeouts, flexible size limits, etc.
43
-
44
-
45
-
## milliparsec
46
-
47
-
`milliparsec` a modern `body-parser` alternative that supports `async / await`, lighter (8 kB vs 62.6 kB for `body-parser`), and [30% faster](https://github.com/tinyhttp/milliparsec/blob/master/bench/index.md)
description: Native Node.js alternatives to the buf-compare package for buffer comparison
3
+
---
2
4
3
-
[`buf-compare`](https://github.com/sindresorhus/buf-compare) recommends that you switch to native `Buffer.compare()` which has been available since Node.js v0.12.0
5
+
# Replacements for `buf-compare`
4
6
5
-
#Alternatives
7
+
## `Buffer.compare` (native)
6
8
7
-
## Node.js
9
+
`Buffer.compare` is a native method which achieves the same result as `buf-compare`, available since Node v0.11.13.
description: Native Node.js alternatives to the buffer-equal package for buffer equality checks
3
+
---
2
4
3
-
[`buffer-equal`](https://www.npmjs.com/package/buffer-equal) and [`buffer-equals`](https://www.npmjs.com/package/buffer-equals) recommends that you switch away from them to native `Buffer.prototype.equals` which has been available since Node.js v0.11.13
5
+
# Replacements for `buffer-equal`
4
6
5
-
#Alternative(s)
7
+
## `Buffer#equals` (native)
6
8
7
-
## Native `Buffer.prototype.equals`
9
+
Buffers have an `equals` method since Node 0.12.
8
10
9
-
For most cases, native Node.js `Buffer.prototype.equals` is enough.
0 commit comments