Socket
Socket
Sign inDemoInstall

ofetch

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ofetch - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

dist/error-04138797.d.ts

6

dist/index.d.ts

@@ -1,3 +0,3 @@

import { $ as $Fetch } from './error-8a55452d.js';
export { $ as $Fetch, C as CreateFetchOptions, b as FetchContext, e as FetchError, c as FetchOptions, F as FetchRequest, a as FetchResponse, S as SearchParameters, d as createFetch, f as createFetchError } from './error-8a55452d.js';
import { $ as $Fetch } from './error-04138797.js';
export { C as CreateFetchOptions, b as FetchContext, e as FetchError, c as FetchOptions, F as FetchRequest, a as FetchResponse, S as SearchParameters, d as createFetch, f as createFetchError } from './error-04138797.js';

@@ -12,2 +12,2 @@ declare const fetch: typeof globalThis.fetch;

export { $fetch, Headers, fetch, ofetch };
export { $Fetch, $fetch, Headers, fetch, ofetch };

@@ -1,3 +0,3 @@

import { $ as $Fetch } from './error-8a55452d.js';
export { $ as $Fetch, C as CreateFetchOptions, b as FetchContext, e as FetchError, c as FetchOptions, F as FetchRequest, a as FetchResponse, S as SearchParameters, d as createFetch, f as createFetchError } from './error-8a55452d.js';
import { $ as $Fetch } from './error-04138797.js';
export { C as CreateFetchOptions, b as FetchContext, e as FetchError, c as FetchOptions, F as FetchRequest, a as FetchResponse, S as SearchParameters, d as createFetch, f as createFetchError } from './error-04138797.js';

@@ -13,2 +13,2 @@ declare function createNodeFetch(): (input: RequestInfo, init?: RequestInit) => any;

export { $fetch, Headers, createNodeFetch, fetch, ofetch };
export { $Fetch, $fetch, Headers, createNodeFetch, fetch, ofetch };
{
"name": "ofetch",
"version": "1.0.0",
"version": "1.0.1",
"description": "A better fetch API. Works on node, browser and workers.",

@@ -14,3 +14,3 @@ "repository": "unjs/ofetch",

"import": "./dist/node.mjs",
"require": "./cjs/node.cjs"
"require": "./dist/node.cjs"
},

@@ -20,3 +20,3 @@ "default": {

"import": "./dist/index.mjs",
"require": "./cjs/index.cjs"
"require": "./dist/index.cjs"
}

@@ -27,6 +27,6 @@ },

"import": "./dist/node.mjs",
"require": "./cjs/node.cjs"
"require": "./dist/node.cjs"
}
},
"main": "./cjs/node.cjs",
"main": "./dist/node.cjs",
"module": "./dist/index.mjs",

@@ -36,4 +36,3 @@ "types": "./dist/index.d.ts",

"dist",
"node.d.ts",
"cjs"
"node.d.ts"
],

@@ -43,29 +42,31 @@ "scripts": {

"dev": "vitest",
"lint": "eslint --ext .ts .",
"lint": "eslint --ext .ts . && prettier -c src test playground",
"lint:fix": "eslint --fix --ext .ts . && prettier -w src test playground",
"prepack": "pnpm build",
"play": "jiti playground/index.ts",
"release": "pnpm test && standard-version && git push --follow-tags && pnpm publish",
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
"test": "pnpm lint && vitest run --coverage"
},
"dependencies": {
"destr": "^1.2.1",
"node-fetch-native": "^1.0.1",
"ufo": "^1.0.0"
"destr": "^1.2.2",
"node-fetch-native": "^1.0.2",
"ufo": "^1.1.0"
},
"devDependencies": {
"@types/node": "^18.11.9",
"@vitest/coverage-c8": "^0.25.2",
"eslint": "^8.27.0",
"eslint-config-unjs": "^0.0.2",
"@types/node": "^18.13.0",
"@vitest/coverage-c8": "^0.28.5",
"changelogen": "^0.4.1",
"eslint": "^8.34.0",
"eslint-config-unjs": "^0.1.0",
"fetch-blob": "^3.2.0",
"formdata-polyfill": "^4.0.10",
"h3": "^1.0.1",
"jiti": "^1.16.0",
"listhen": "^1.0.0",
"standard-version": "^9.5.0",
"typescript": "^4.8.4",
"unbuild": "^0.9.4",
"vitest": "^0.25.2"
"h3": "^1.4.0",
"jiti": "^1.17.0",
"listhen": "^1.0.2",
"prettier": "^2.8.4",
"typescript": "^4.9.5",
"unbuild": "^1.1.1",
"vitest": "^0.28.5"
},
"packageManager": "pnpm@7.16.0"
"packageManager": "pnpm@7.27.0"
}

@@ -5,3 +5,2 @@ # ofetch

[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Github Actions][github-actions-src]][github-actions-href]
[![Codecov][codecov-src]][codecov-href]

@@ -138,3 +137,3 @@ [![bundle][bundle-src]][bundle-href]

You might want to use `ofetch.create` to set set shared interceptors.
You might want to use `ofetch.create` to set shared interceptors.

@@ -200,5 +199,5 @@ ### `onRequest({ request, options })`

This utility is useful if you need to use common options across serveral fetch calls.
This utility is useful if you need to use common options across several fetch calls.
**Note:** Defaults will be cloned at one level and inherrited. Be careful about nested options like `headers`.
**Note:** Defaults will be cloned at one level and inherited. Be careful about nested options like `headers`.

@@ -224,2 +223,14 @@ ```js

## 💡 Adding HTTP(S) Agent
If you need use HTTP(S) Agent, can add `agent` option with `https-proxy-agent` (for Node.js only):
```js
import { HttpsProxyAgent } from "https-proxy-agent";
await ofetch('/api', {
agent: new HttpsProxyAgent('http://example.com')
})
```
## 🍣 Access to Raw Response

@@ -226,0 +237,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc