Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@huksley/request

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@huksley/request - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

package.json
{
"name": "@huksley/request",
"version": "1.0.4",
"version": "1.0.5",
"description": "[gist-sized] Zero dependency, single-file NodeJS 14+ HTTP(s) request module",

@@ -5,0 +5,0 @@ "main": "request.js",

@@ -1,22 +0,30 @@

export interface Options {
method?: string;
headers?: { [key: string]: string };
verbose?: boolean;
/** Default is 10000 */
timeout?: number;
encoding?: string;
body?: any;
import { IncomingMessage } from "http";
declare module "./request.js" {
export interface Options {
method?: string;
headers?: { [key: string]: string };
verbose?: boolean;
/** Default is 10000 */
timeout?: number;
encoding?: string;
body?: any;
}
export interface Response<T> extends IncomingMessage {
body: T;
}
/**
* Makes HTTP(s) request and returns response with parsed body.
*
* ```
* const res = await request("https://jsonip.com")
* console.info("Your IP", res.body.ip, "headers", res.headers)
* ```
* @param {*} url - Absolute URL
* @param {*} options - Options, like in fetch
* @returns {IncomingMessage} Http response with body
*/
export function request<T>(url: string, options?: Options): T;
}
/**
* Makes HTTP(s) request and returns response with parsed body.
*
* ```
* const res = await request("https://jsonip.com")
* console.info("Your IP", res.body.ip, "headers", res.headers)
* ```
* @param {*} url - Absolute URL
* @param {*} options - Options, like in fetch
* @returns {IncomingMessage} Http response with body
*/
export function request(url: string, options?: Options);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc