@artiefuzzz/lynx
TypeScript icon, indicating that this package has built-in type declarations

2.5.6 • Public • Published

@artiefuzzz/lynx

Lightweight HTTP client Inspired by @augu/orchid and centra

Installation

NPM:

npm install @artiefuzzz/lynx

Yarn:

yarn add @artiefuzzz/lynx

Usage

Note: Although we are using import { request } from '@artiefuzzz/lynx' it still is the same as using const { request } = require('@artiefuzzz/lynx')

Simple GET request:

import { request } from "@artiefuzzz/lynx";

const response = await request(
  "https://jsonplaceholder.typicode.com/todos/1"
).send();

console.log(response.json);

Simple POST request:

import { request, SendAs } from "@artiefuzzz/lynx";

const response = await request(
  "https://jsonplaceholder.typicode.com/posts",
  "POST"
)
  .body(
    {
      title: "Hello World!",
      body: "foobar",
      userId: 101,
    },
    SendAs.JSON
  )
  .send();

console.log(response.json);

If you encounter an issue please open a Issue on the Repository here

Package Sidebar

Install

npm i @artiefuzzz/lynx

Weekly Downloads

3

Version

2.5.6

License

MIT

Unpacked Size

46 kB

Total Files

13

Last publish

Collaborators

  • artiefuzzz