Package

purescript-milkis

Repository
justinwoo/purescript-milkis
License
MIT
Uploaded by
justinwoo
Published on
2018-05-27T22:03:50Z

Build Status

A wrapper around node-fetch for all your request needs.

Aptly named for the greatest soft drink of all time, Milkis.

Installation

npm install --save node-fetch

bower install --save purescript-milkis

Usage

See the tests

Example Usage

I use Milkis in my ytcasts project in order to download HTML from a Youtube page:

downloadCasts ::
  forall e.
  DBConnection ->
  Url ->
  Aff
    (Program e)
    (Array CastStatus)
downloadCasts conn (Url url) = do
  res <- text =<< fetch url defaultFetchOptions
  case getCasts res of
    Right casts -> for casts $ downloadCast conn
    Left e -> do
      errorShow e
      pure []