Skip to content
the cleanest way to make http requests in js / node
Branch: master
Clone or download
Latest commit bc4483c May 25, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Fix uncaught fetch May 25, 2017
tests Fix uncaught fetch May 25, 2017
.all-contributorsrc Add @raygesualdo as a contributor Dec 9, 2016
.babelrc updated babel dependencies Dec 9, 2016
.gitignore added node_modules to .gitignore Dec 9, 2016
.npmignore Got lib working :) Dec 9, 2016 added file on contributing Dec 9, 2016 Fix mardown heading & new line (#25) Apr 13, 2017
circle.yml Got lib working :) Dec 9, 2016
package.json Fix uncaught fetch May 25, 2017

All Contributors


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.


import request from 'legible'

async function TestRequest() {
  let body = {
    email: '',
    password: 'secret'

  let response = await request`
    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`
    method: POST

  body: ${{
    email: '',
    password: 'Tester'


Coming Soon The following isn't implemented yet.

import request from 'legible'

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


Thanks goes to these wonderful people (emoji key):

Zach Silveira

💻 📖 👀

Ray Gesualdo

💻 📖

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

You can’t perform that action at this time.