nyro
v2.0.0
Published
A simple and effective promise-based HTTP & HTTP/2 request library that supports all HTTP methods.
Downloads
359
Maintainers
Keywords
Readme
Installation
Using npm:
$ npm install nyro@latest
Other Installations:
$ yarn add nyro@latest
$ pnpm add nyro@latest
$ deno install npm:nyro@latest
Example Basic Usage
import nyro, { ResponseType, Method } from 'nyro';
(async() => {
const { body } = await nyro({
url: 'https://hercai.onrender.com/v3/hercai',
params: {
question: 'Hi How Are You?'
}
method: Method.Get, // Or 'GET'
responseType: ResponseType.Json, // Or 'json'
headers: {
'User-Agent': 'Nyro'
},
bodySchema: {
content: String,
reply: String
}
});
console.log('Your Question; ' + body.content);
console.log('AI Reply; ' + body.reply);
})();
Documentation
Main Request
- [x]
Promise Requests
- [x]
Options
- [x]
Stream Request
- [x]
Queue Request
- [x]
Pagination API
- [x]
Create / Extend Request
- [x]
HTTP/2 Support
- [x]
Response
Timeouts, Retries And Error
Other Options
- [x]
Cache
- [x]
Proxy Support
- [x]
Abort / Cancel Request
- [x]
BodySchema
- [x]
SSL Options
- [x]
Browser Support (Node Only)
Advanced Options
Special Features
License
Nyro is licensed under the GPL-3.0 License. See the LICENSE file for details.