A wrapper around node-fetch for fetch requests through Node.
Aptly named for the greatest soft drink of all time, Milkis.
npm install --save node-fetch
bower install --save purescript-milkis
See the tests
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 []