JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 13
  • Score
    100M100P100Q27298F
  • License MIT

request library wrapped into fluture library

Package Exports

  • request-f

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (request-f) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

request-f

Fantasy Land Future compatible request library based on request, fluture and sancturay.

Methods

Every methods have next signature.

<methodName> :: String s -> Future a s
<methodName> :: RequestOptions o -> Future a o

List of RequestOptions see here

Examples

Simple example

const requestF = require('request-f');

requestF
  .get('http://site.com')
  .fork(console.error, console.log);
  // -> Right({ body: '...', statusCode: '...', headers: { ... } })

Using with Sanctuary

const { create, env } = require('sanctuary');
const { env: flutureEnv } = require('fluture-sanctuary-types');

const S = create({
  checkTypes: true,
  env: env.concat(flutureEnv),
});

const getBody = S.map(S.prop('body'));

requestF
  .get('http://site.com')
  .map(getBody)
  .fork(console.error, console.log);
  // -> Right('<body value>')

Learn more about integration fluture with sanctuary


MIT License