Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

getsling/bs-node-fetch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bindings to fetch for BuckleScript.

Example

(* OCaml *)
let _ =
  Js.Promise.(
    fetch "/api/hellos/1"
    |> then_ Response.text
    |> then_ (fun text -> print_endline text |> resolve)
  )
/* Reason */
Js.Promise.(
  fetch "/api/hellos/1"
  |> then_ Response.text
  |> then_ (fun text => print_endline text |> resolve)
);

Installation

npm install --save bs-node-fetch

Then add bs-node-fetch to bs-dependencies in your bsconfig.json:

{
  ...
  "bs-dependencies": ["bs-node-fetch"]
}

Usage

See usage examples in examples/examples.ml. The source is a single file!

Credits

This is a fork from bs-fetch with minor modifications for node-fetch. All credits go to the authors of that package.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • OCaml 61.3%
  • JavaScript 38.7%