JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2279
  • Score
    100M100P100Q113525F
  • License LGPL-3.0-or-later

A simple and effective promise-based HTTP request library that supports all HTTP methods.

Package Exports

  • nyro

Readme


A simple and effective promise-based HTTP request library that supports all HTTP methods.

Discord Buy Me A Coffee

Installation

Using npm:

$ npm install nyro

Other Installations:

$ yarn add nyro
$ pnpm add nyro

Usage

import nyro, { ContentType, ResponseEncoding, ResponseType, StatusCode, Method } from 'nyro';

(async() => {

 var response = await nyro({
    url: 'https://hercai.onrender.com/v3/hercai',
    params: {
        question: 'Hi How Are You?'
    }
    method: Method.Get,
    responseType: ResponseType.Json,
    headers: {
        'Authorization': '...someOneSecretKey',
        'User-Agent': 'Nyro'
    },
    bodySchema: {
        content: String,
        reply: String
    }
 });

  var body = response.body;

  console.log('Your Question; ' + body.content);
  console.log('AI Reply; ' + body.reply);


})();

For Fake UserAgent

import nyro, { userAgentGenerator } from 'nyro';

nyro({
    url: 'https://someoneapi.com',
    method: 'GET',
    headers: {
        'User-Agent': userAgentGenerator()
    }
}).then((response) => {
    console.log(response.config.headers);
    console.log(response.body);
});

License

nyro is licensed under the MIT License. See the LICENSE file for details.

Support

Discord Banner