Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bare-fetch

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bare-fetch

WHATWG Fetch implementation for Bare

  • 2.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
169
increased by6.96%
Maintainers
0
Weekly downloads
 
Created
Source

bare-fetch

WHATWG Fetch implementation for Bare.

npm i bare-fetch

Usage

const fetch = require('bare-fetch')

const res = await fetch('https://api.restful-api.dev/objects/7')

console.log(await res.text())

API

const response = await fetch(url[, options])

Response

response.headers

The response headers.

response.status

The HTTP status code of the response.

response.redirected

Whether or not the request has been redirected to a different URL.

response.body

The response body stream.

response.bodyUsed

Whether or not the stream has already been consumed.

response.buffer()

Consumes the stream and returns a Buffer.

response.bytes()

Consumes the stream and returns a Uint8Array.

response.arrayBuffer()

Consumes the stream and returns an ArrayBuffer.

response.text()

Consumes the stream and returns a UTF-8 string.

response.json()

Consumes the stream and returns a JSON value.

License

Apache-2.0

FAQs

Package last updated on 12 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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