Socket
Socket
Sign inDemoInstall

@glennsl/rescript-fetch

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@glennsl/rescript-fetch

Zero-cost rescript bindings to the WHATWG Fetch API


Version published
Maintainers
1
Weekly downloads
1,391
decreased by-2.93%

Weekly downloads

Readme

Source

rescript-fetch

Zero-cost rescript bindings to the WHATWG Fetch API

npm Issues Last Commit

Example

let postBanana = async data => {
  open Fetch

  let response = await fetch(
    "/api/bananas",
    {
      method: #POST,
      body: data->Js.Json.stringifyAny->Belt.Option.getExn->Body.string,
      headers: Headers.fromObject({
        "Content-type": "application/json",
      }),
    },
  )

  await response->Response.json
}

See examples for more.

Installation

npm install --save @glennsl/rescript-fetch

Then add @glennsl/rescript-fetch to bs-dependencies in your bsconfig.json:

 {
   "bs-dependencies": [
+    "@glennsl/rescript-fetch"
   ]
 }

Documentation

API

For the moment, please see the interface file:

  • Fetch

Changes

0.2.0

  • [BREAKING] Updated required minimum version of rescript to 10.1.2 in order to use the new promise type alias and async/await.
  • Removed @ryyppy/rescript-promise dependency.

0.1.0

Initial release

Keywords

FAQs

Last updated on 18 Feb 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc