Socket
Socket
Sign inDemoInstall

minreq

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minreq

minimalistic request library


Version published
Maintainers
1
Created
Source

#minreq A minimalistic request library for node.

##How? npm install minreq

##Why?

The most common library used to perform http(s)-requests in node is request. While it works, it has a lot of features that aren't needed in most cases (eg. cookies, oauth). Besides, the code isn't as fast as it can be. This project is intended to replace request in cases where it's simply too heavy.

##What? ###Features

  • request like api
  • lightweight (compared to this lib, request is a giant)
  • provides a callback that's called when a response was received (like request)
  • works as a stream (Stream#pipe is supported)
  • forwards events
  • follows redirects
  • you may add your own protocols!

###Options

  • uri: Object that's passed to http(s).request (as described here)
  • followRedirect: Boolean that indicates whether redirects should be followed
  • maxRedirects: int with the maximum number of redirects (defaults to 10)
  • body: that data that should be passed to the request
  • encoding: the encoding that all data should use (the body will always be a string)
  • timeout: a request times out if it passes this limit. Defaults to 10000 (read: 10 seconds)
  • only2xx: only permit status codes >= 200 and < 300 (otherwise, throw an error)

License: Public domain

Keywords

FAQs

Package last updated on 21 Sep 2012

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

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