rock-req 5.1.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
<h1 align="center" style="border-bottom:none; font-size: 2.2em;">Rock-req.js</h1>
|
|
7
7
|
|
|
8
8
|
<p align="center">⭐️⭐️ Ensure your HTTP requests always reach their destination as <b>efficiently</b> as possible! ⭐️⭐️</p>
|
|
9
|
+
<p align="center">Tested on Mac, Linux, Windows with NodeJS 16, 18, 19</p>
|
|
9
10
|
|
|
10
11
|
[![npm][npm-image]][npm-url] [![ci][ci-image]][ci-url] [![javascript style guide][standard-image]][standard-url]
|
|
11
12
|
|
|
@@ -68,7 +69,7 @@ Stop using "slow by-default" and "false-light" HTTP request libraries!
|
|
|
68
69
|
|
|
69
70
|
> `undici` is a low-level API, faster alternative to the native NodeJS http module. It is the glass ceiling limit for NodeJS.
|
|
70
71
|
|
|
71
|
-
> `rock-req` uses only the native NodeJS http module and provides many high-level features, a lot more than `phin` and `simple-get` with fewer lines
|
|
72
|
+
> `rock-req` uses only the native NodeJS http module and provides many high-level features, a lot more than `phin` and `simple-get` with fewer lines of code.
|
|
72
73
|
|
|
73
74
|
> Tested with NodeJS 18.x LTS on Macbook Pro M1 Max
|
|
74
75
|
|
package/index.js
CHANGED
|
@@ -77,7 +77,7 @@ function extend (defaultOptions = {}) {
|
|
|
77
77
|
}
|
|
78
78
|
let data = Buffer.concat(chunks)
|
|
79
79
|
if (opts.json) {
|
|
80
|
-
try { data = JSON.parse(data.toString()) } catch (e) { return cb(e, response, data) }
|
|
80
|
+
try { data = data.length > 0 ? JSON.parse(data.toString()) : null } catch (e) { return cb(e, response, data) }
|
|
81
81
|
}
|
|
82
82
|
cb(null, response, data)
|
|
83
83
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rock-req",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "5.1.
|
|
3
|
+
"description": "Ultra-light (150 LOC, No dependencies) & Ultra-fast request library with reliable retry on failure, http/https, redirects, gzip/deflate/brotli, extensible, proxy, streams, JSON mode, forms, timeout",
|
|
4
|
+
"version": "5.1.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "David Grelaud & Feross Aboukhadijeh"
|
|
7
7
|
},
|