node-superfetch
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -29,6 +29,3 @@ const FormData = require('form-data'); | ||
let raw = null; | ||
if (!this.noResultData) { | ||
raw = await response.arrayBuffer(); | ||
raw = arrayBufferToBuffer(raw); | ||
} | ||
if (!this.noResultData) raw = arrayBufferToBuffer(await response.arrayBuffer()); | ||
const headers = {}; | ||
@@ -35,0 +32,0 @@ for (const [header, value] of response.headers.entries()) headers[header] = value; |
Internet Systems Consortium license | ||
=================================== | ||
Copyright (c) 2017-2018, dragonfire535 | ||
Copyright (c) 2017-2022, dragonfire535 | ||
@@ -6,0 +6,0 @@ Permission to use, copy, modify, and/or distribute this software for any purpose |
{ | ||
"name": "node-superfetch", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "A wrapper for Node.js' fetch API that makes it appear like superagent.", | ||
@@ -34,2 +34,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"arraybuffer-to-buffer": "^0.0.7", | ||
"form-data": "^4.0.0" | ||
@@ -39,3 +40,2 @@ }, | ||
"@types/node": "^18.7.18", | ||
"arraybuffer-to-buffer": "^0.0.7", | ||
"eslint": "^8.23.1", | ||
@@ -42,0 +42,0 @@ "eslint-config-amber": "^2.0.4", |
# node-superfetch | ||
[![Downloads](https://img.shields.io/npm/dt/node-superfetch.svg?maxAge=3600)](https://www.npmjs.com/package/node-superfetch) | ||
[![Version](https://img.shields.io/npm/v/node-superfetch.svg?maxAge=3600)](https://www.npmjs.com/package/node-superfetch) | ||
[![Travis](https://api.travis-ci.org/dragonfire535/node-superfetch.svg?branch=master)](https://travis-ci.org/dragonfire535/node-superfetch) | ||
node-superfetch is a tiny little wrapper for | ||
[node-fetch](https://www.npmjs.com/package/node-fetch) that makes it look like | ||
you are using [superagent](https://www.npmjs.com/package/superagent). It arose | ||
after I decided I disliked the node-fetch API and loved the superagent API, but | ||
node-fetch is smaller than superagent and snekfetch is buggy | ||
(~~and this probably is too~~). | ||
node-superfetch is a tiny little wrapper for Node.js' fetch API that makes it | ||
look like you are using [superagent](https://www.npmjs.com/package/superagent). | ||
@@ -18,3 +13,3 @@ ## Basic Usage | ||
try { | ||
const { body } = await request.get('https://registry.npmjs.com/node-fetch'); | ||
const { body } = await request.get('https://registry.npmjs.com/node-superfetch'); | ||
console.log(body); | ||
@@ -33,7 +28,7 @@ } catch (err) { | ||
except the actual result data of the request. This is essentially doing the | ||
request without calling any of `node-fetch`'s methods to parse the result data. | ||
request without calling any methods to parse the result data. | ||
```js | ||
const { headers, url } = await request.get('https://registry.npmjs.com/node-fetch', { noResultData: true }); | ||
console.log(url); // should log https://registry.npmjs.com/node-fetch | ||
const { headers, url } = await request.get('https://registry.npmjs.com/node-superfetch', { noResultData: true }); | ||
console.log(url); // should log https://registry.npmjs.com/node-superfetch | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
10148
2
209
33
+ Addedarraybuffer-to-buffer@^0.0.7
+ Addedarraybuffer-to-buffer@0.0.7(transitive)