chainfetch
Advanced tools
Comparing version 1.2.0 to 1.2.1
{ | ||
"name": "chainfetch", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "A simple, chainable wrapper around node-fetch!", | ||
"main": "src/index", | ||
"typings": "./typings/index.d.ts", | ||
"typings": "typings/index.d.ts", | ||
"scripts": { | ||
@@ -12,3 +12,3 @@ "test": "npx eslint src" | ||
"type": "git", | ||
"url": "git+https://github.com/KingDGrizzle/chainfetch.git" | ||
"url": "git+https://github.com/vladfrangu/chainfetch.git" | ||
}, | ||
@@ -26,5 +26,5 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/KingDGrizzle/chainfetch/issues" | ||
"url": "https://github.com/vladfrangu/chainfetch/issues" | ||
}, | ||
"homepage": "https://github.com/KingDGrizzle/chainfetch#readme", | ||
"homepage": "https://github.com/vladfrangu/chainfetch#readme", | ||
"devDependencies": { | ||
@@ -35,5 +35,5 @@ "@types/node-fetch": "^2.1.2", | ||
}, | ||
"dependencies": { | ||
"peerDependencies": { | ||
"node-fetch": "^2.2.0" | ||
} | ||
} |
@@ -50,2 +50,21 @@ <div> | ||
## Are you a TypeScript user | ||
We got you covered! We have rich typings which should work in all cases (if not, feel free to submit an issue ❤️) | ||
```ts | ||
import chainfetch from 'chainfetch'; | ||
// Or | ||
import { get } from 'chainfetch'; | ||
// Or | ||
import * as chainfetch from 'chainfetch'; | ||
// Works | ||
chainfetch.get(); | ||
// If you want to create your own custom class for custom handling | ||
const myCustomClass = new chainfetch('HTTP METHOD', 'URL'); | ||
myCustomClass.get(); | ||
``` | ||
## Meaning of `toJSON`, `toText` and `toBuffer` | ||
@@ -52,0 +71,0 @@ |
@@ -19,3 +19,3 @@ const { METHODS } = require('http'); | ||
* Creates an instance of Chainfetch. | ||
* @param {METHODS} method The HTTP method for this request | ||
* @param {string} method The HTTP method for this request | ||
* @param {string} url The URL | ||
@@ -330,1 +330,3 @@ * @param {Object} [options={}] The fetch options | ||
module.exports = Chainfetch; | ||
// For TS users since TS adds .default to our require if you use the `import fetch from 'chainfetch'` imports | ||
module.exports.default = Chainfetch; |
@@ -13,2 +13,3 @@ declare module 'chainfetch' { | ||
private error: Error; | ||
new(method: HTTPMethod, url: URL, options?: ChainfetchOptions): Chainfetch; | ||
public constructor(method: HTTPMethod, url: URL, options?: ChainfetchOptions); | ||
@@ -18,3 +19,3 @@ public query(name: Array<string[]> | { [key: string]: string } | string, value?: string): Chainfetch; | ||
public attach(name: { [key: string]: GenericValue } | string, value?: GenericValue, filename?: string): Chainfetch; | ||
public send(data: FormData | Buffer | Stream | object): Chainfetch; | ||
public send(data: FormData | Buffer | Stream | object | string): Chainfetch; | ||
public setRedirect(redirect: boolean): Chainfetch; | ||
@@ -31,2 +32,36 @@ public setFollowCount(count?: number): Chainfetch; | ||
public catch(onrejected?: ((error: ResponseError) => any | PromiseLike<any>) | undefined | null): Promise<ResponseError>; | ||
public static acl(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static bind(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static checkout(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static connect(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static copy(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static delete(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static get(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static head(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static link(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static lock(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static merge(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static mkactivity(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static mkcalendar(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static mkcol(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static move(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static notify(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static options(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static patch(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static post(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static propfind(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static proppatch(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static purge(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static put(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static rebind(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static report(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static search(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static source(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static subscribe(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static trace(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static unbind(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static unlink(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static unlock(url: string, options?: ChainfetchOptions): Chainfetch; | ||
public static unsubscribe(url: string, options?: ChainfetchOptions): Chainfetch; | ||
} | ||
@@ -33,0 +68,0 @@ |
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
82232
2154
80
- Removednode-fetch@^2.2.0