Skip to content
/ aika Public

๐Ÿšš Another tiny HTTP library for JavaScript

License

Notifications You must be signed in to change notification settings

sondregj/aika

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

24 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿšš

Aika

A minimal, asynchronous HTTP client for Node.js

Travis Build Status npm (latest) npm bundle size GitHub contributors License Gitmoji

This library is not feature complete yet.

Everything is asynchronous.

Progress

  • Basic requests
  • Bodies and querystrings
  • Header Builder
  • General middleware
  • Tests
  • Documentation

Usage

(Some features are planned and not implemented)

const Aika = require('aika')

const aika = new Aika()

// Middleware support (planned)
aika.use(headerBuilder)

// Perform HTTP(S) requests
aika.host('google.com')
    .get('/search', {q: 'horses'})
    .then(res => console.log(res))
    .catch(err => console.log(err))

// Parse JSON response
aika.host('cat-fact.herokuapp.com')
    .get('/facts')
    .then(res => console.log(res.json()))
    .catch(err => console.log(err))

Middleware

A middleware is any object that has a middleware function. The function should take a request object as its only parameter and return it after doing it's thing.

Development

First, clone the repo, and do npm install.

Run tests with npm test.

Run linter with npm run lint

Do not commit directly to master. Preferably, make a branch or fork out of the development branch and make a pull request.

License

MIT ยฉ 2019 Sondre Gjellestad

About

๐Ÿšš Another tiny HTTP library for JavaScript

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published