Skip to content

Commit

Permalink
Fix dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyissillyyy committed Oct 12, 2022
1 parent 0a093c0 commit e9c211c
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/
package-lock.json
logs/
*.log
.DS_Store
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ logs/
.gitignore
.gitattributes
.travis.yml
.DS_Store
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Internet Systems Consortium license
===================================

Copyright (c) 2017-2018, dragonfire535
Copyright (c) 2017-2022, dragonfire535

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ look like you are using [superagent](https://www.npmjs.com/package/superagent).
const request = require('node-superfetch');

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);
} catch (err) {
console.error(err);
Expand All @@ -24,9 +24,9 @@ FormData), `redirects` (for setting the allowed number of redirects), and

Additionally, you can also use the `noResultData` option to get everything
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
```
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ class Request {
agent: this.agent
});
let raw = null;
if (!this.noResultData) {
raw = await response.arrayBuffer();
raw = arrayBufferToBuffer(raw);
}
if (!this.noResultData) raw = arrayBufferToBuffer(await response.arrayBuffer());
const headers = {};
for (const [header, value] of response.headers.entries()) headers[header] = value;
const res = {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"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.",
"main": "index.js",
"typings": "typings/index.d.ts",
Expand Down Expand Up @@ -31,11 +31,11 @@
"node": ">=18"
},
"dependencies": {
"arraybuffer-to-buffer": "^0.0.7",
"form-data": "^4.0.0"
},
"devDependencies": {
"@types/node": "^18.7.18",
"arraybuffer-to-buffer": "^0.0.7",
"eslint": "^8.23.1",
"eslint-config-amber": "^2.0.4",
"eslint-plugin-json": "^3.1.0",
Expand Down

0 comments on commit e9c211c

Please sign in to comment.