All Projects → Legitcode → legible

Legitcode / legible

Licence: other
the cleanest way to make http requests in js / node

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to legible

Create Request
Apply interceptors to `fetch` and create a custom request function.
Stars: ✭ 34 (-30.61%)
Mutual labels:  fetch, request, fetch-api
Frisbee
🐕 Modern fetch-based alternative to axios/superagent/request. Great for React Native.
Stars: ✭ 1,038 (+2018.37%)
Mutual labels:  fetch, request, fetch-api
fetch
A fetch API polyfill for React Native with text streaming support.
Stars: ✭ 27 (-44.9%)
Mutual labels:  fetch, fetch-api
Php Fetch
A simple, type-safe, zero dependency port of the javascript fetch WebApi for PHP
Stars: ✭ 95 (+93.88%)
Mutual labels:  fetch, fetch-api
hermes-js
Universal action dispatcher for JavaScript apps
Stars: ✭ 15 (-69.39%)
Mutual labels:  fetch, request
React Ufo
🛸 react-ufo - A simple React hook to help you with data fetching 🛸
Stars: ✭ 85 (+73.47%)
Mutual labels:  fetch, fetch-api
Mfetch
mfetch will provide you with a strong ability to request resource management
Stars: ✭ 90 (+83.67%)
Mutual labels:  fetch, request
Holen
Declarative fetch for React
Stars: ✭ 152 (+210.2%)
Mutual labels:  fetch, request
Wretch Middlewares
Collection of middlewares for the Wretch library. 🎁
Stars: ✭ 42 (-14.29%)
Mutual labels:  fetch, request
Fetch Ponyfill
WHATWG fetch ponyfill
Stars: ✭ 209 (+326.53%)
Mutual labels:  fetch, fetch-api
Wretch
A tiny wrapper built around fetch with an intuitive syntax. 🍬
Stars: ✭ 2,285 (+4563.27%)
Mutual labels:  fetch, request
AxleJS
Fetch, supercharged.
Stars: ✭ 28 (-42.86%)
Mutual labels:  fetch, request
Cross Fetch
Universal WHATWG Fetch API for Node, Browsers and React Native.
Stars: ✭ 1,063 (+2069.39%)
Mutual labels:  fetch, fetch-api
Redux Query
A library for managing network state in Redux
Stars: ✭ 1,055 (+2053.06%)
Mutual labels:  fetch, request
Apipeline
Feature-rich and pluggable offline-first API wrapper for all your javascript environements ! Easily wire-up your API and make your app work offline in minutes.
Stars: ✭ 92 (+87.76%)
Mutual labels:  fetch, request
Use Http
🐶 React hook for making isomorphic http requests
Stars: ✭ 2,066 (+4116.33%)
Mutual labels:  fetch, request
Composable Fetch
A library that brings composition to http requests & solves most common tasks
Stars: ✭ 23 (-53.06%)
Mutual labels:  fetch, request
rxrest
Reactive rest library
Stars: ✭ 33 (-32.65%)
Mutual labels:  fetch, request
Zl Fetch
A library that makes the Fetch API a breeze
Stars: ✭ 186 (+279.59%)
Mutual labels:  fetch, fetch-api
hent
A small utility to fetch remote files into buffers
Stars: ✭ 23 (-53.06%)
Mutual labels:  fetch, request

CircleCI
All Contributors

Legible

See my blog post on why I made this

Proof of concept at making http requests easier to work with in JS / Node. This wraps the fetch api.

npm install legible --save

A request library using template literals. Making requests has never been so straight forward! Make it easy for users to adopt your api, document it using this library, and everyone will understand making requests.

Example

import request from 'legible'

async function TestRequest() {
  let body = {
    email: '[email protected]',
    password: 'secret'
  }

  let response = await request`
    url: https://api.myapp.com/register
    method: POST
    body: ${body}
    headers: ${{
      Authorization: 'Bearer: token'
    }}
  `
}

Partial Requests

New in 0.2.0!

Using template strings, we can pull out variables easily and keep requests as legible as possible. Imagine splitting out your code like this using api libraries that include requests like so:

import { partial } from 'legible'

const twitter = {
  register: partial`
    url: https://api.twitter.com/register,
    method: POST
  `
}

twitter.register`
  body: ${{
    email: '[email protected]',
    password: 'Tester'
  }}
`

Middleware

Coming Soon The following isn't implemented yet.

import request from 'legible'

request.middleware({
  headers: {
    Authorization: `Bearer: ${localStorage.getItem('token')}`
  },
  after({ headers }) {
    localStorage.setItem('token', headers.Authorization)
  }
})

Contributors

Thanks goes to these wonderful people (emoji key):


Zach Silveira

💻 📖 👀

Ray Gesualdo

💻 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].