https://github.com/sondregj/aika
🚚 Another tiny HTTP library for JavaScript
https://github.com/sondregj/aika
browser http https node typescript
Last synced: about 2 months ago
JSON representation
🚚 Another tiny HTTP library for JavaScript
- Host: GitHub
- URL: https://github.com/sondregj/aika
- Owner: sondregj
- License: mit
- Created: 2019-03-13T15:43:35.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-02-11T17:36:07.000Z (over 3 years ago)
- Last Synced: 2025-03-29T02:52:46.593Z (about 2 months ago)
- Topics: browser, http, https, node, typescript
- Language: JavaScript
- Homepage:
- Size: 436 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
🚚
AikaA minimal, asynchronous HTTP client for Node.js
*This library is not feature complete yet.*
Everything is asynchronous.
## Progress
- [x] Basic requests
- [x] Bodies and querystrings
- [x] Header Builder
- [x] General middleware
- [ ] Tests
- [ ] Documentation## Usage
*(Some features are planned and not implemented)*
```javascript
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