Skip to content

About

🌲 Utilities for Response

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

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.

About

🌲 Utilities for Response

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages