Licence
MIT
Version
0.6.1
Deps
2
Size
10 kB
Vulns
0
Weekly
0
extra-response
Utilities for Response.
Install
npm install --save extra-response
# or
yarn add extra-response
API
ok
ok(res: Response): Promise<Response>
If res.ok is false, it will throw HTTPError.
toJSON
toJSON(res: Response): Promise<Json>
toText
toText(res: Response, charset?: string): Promise<string>
toLines
toLines(
res: Response
, newline: string = '\n'
): AsyncIterable<string>
Not available for node-fetch, because it is not provide the WHATWG ReadableStream as body.
toNDJSON
toNDJSON(
res: Response
, newline: string = '\n'
): AsyncIterable<Json>
Not available for node-fetch, because it is not provide the WHATWG ReadableStream as body.