npm.io
0.6.1 • Published 1 year ago

aminiq

Licence
MIT
Version
0.6.1
Deps
0
Size
18 kB
Vulns
0
Weekly
0

AMINIQ

Another asynchronous mini request client for Node.js with 0 dependencies.

Install

npm install aminiq

Mini GET Example

const request = await aminiq("http://localhost:80/")

console.log(request.data)
console.log(request.response)

Example GET

import {aminiq} from "aminiq"

(async ()=>{
   // use object....
   let ip = await aminiq({
      hostname: "ipinfo.io",
      path: "/ip",
      method: "GET",
      port: 443,
      fileName: "",
      download: false,
      https: true
   })

   // ...or just a string
   let ip2 = await aminiq("https://ipinfo.io/ip")

   console.log(ip.data)
   console.log(ip2.data)
})()

Example POST

aminiq({
   // options
   download: false,
   fileName: "",
   hostname: this.hostname,
   https: true,
   method: this.method,
   path: this.url,
   port: 443,
   headers: this.headers
   },{
      // post data
      "param1": "value",
      "param2": "value",
      "param3": "value"
   }
})

Notes

  • Post requests only work with application/x-www-form-urlencoded