🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

puny-req

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons

puny-req

Tiny and lightweight promise based HTTP(S) request library (70 sloc)

unpublished
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
14
180%
Maintainers
1
Weekly downloads
 
Created
Source

📡 req

Tiny and lightweight promise based HTTP(S) request library (70 sloc)

Package version Downloads Standard Travis Build GitHub version License PRs


Built with ❤︎ by Tiaan and contributors

Table of Contents

Table of Contents
  • Install
  • Usage
  • API
  • CLI
  • Contribute
  • License
  • Install

    $ npm install --save puny-req
    # OR
    $ yarn add puny-req
    

    Usage

    const req = require('puny-req')
    
    // GET request
    req('https://jsonplaceholder.typicode.com/posts/1').then((res) => {
      console.log(res.headers, res.body)
    }).catch(console.log)
    
    // POST request
    req({
      url: 'https://jsonplaceholder.typicode.com/posts',
      json: {
        title: 'Hi', body: 'Friend', userId: 1
      }
    }).then((res) => {
      console.log(res.headers, res.body)
    }).catch(console.log)
    
    

    API

    Module exports a single function that returns a promise. It accepts a url string as argument for simple GET requests or an object with the following options:

    {
      url: String, // (Required)
      port: Int, // Port of request. Defaults to 80 or 443 depending on protocol
      headers :Object, // Headers associated with request. If form or json property provided, correct headers will be added
      method: String, // Method of request, Defaults to GET or POST if form or json property provided
      auth: String, // Authorization in 'user:password' format
      encoding: String // Encoding defaulted to UTF-8
      form: Object || String, // form data to POST
      json: Object // Object to POST,
    }
    

    The promise resolves with the response object. The body is parsed to a object if possible.

    CLI

    The CLI is currently a work in progress.

    Contribute

    Contributions are welcome. Please open up an issue or create PR if you would like to help out.

    Note: If editing the README, please conform to the standard-readme specification.

    License

    Licensed under the MIT License.

    Keywords

    http

    FAQs

    Package last updated on 24 Nov 2025

    Did you know?

    Socket

    Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

    Install

    Related posts