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

hyperquest

Package Overview
Dependencies
Maintainers
3
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperquest

make streaming http requests

  • 2.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
162K
increased by6.13%
Maintainers
3
Weekly downloads
 
Created

What is hyperquest?

The hyperquest npm package is a streaming HTTP client for Node.js. It is designed to be a lightweight and efficient way to make HTTP requests, with a focus on streaming data directly to and from the network.

What are hyperquest's main functionalities?

Making a GET request

This feature allows you to make a simple GET request to a URL and pipe the response directly to a file. In this example, the response from 'http://www.google.com' is written to 'google.html'.

const hyperquest = require('hyperquest');
const fs = require('fs');

hyperquest('http://www.google.com').pipe(fs.createWriteStream('google.html'));

Making a POST request

This feature allows you to make a POST request and stream data from a file to the server. In this example, the contents of 'file.txt' are sent to 'http://example.com/upload' and the server's response is printed to the console.

const hyperquest = require('hyperquest');
const fs = require('fs');

const req = hyperquest.post('http://example.com/upload');
fs.createReadStream('file.txt').pipe(req);
req.pipe(process.stdout);

Handling errors

This feature demonstrates how to handle errors when making a request. In this example, an error event listener is added to handle any errors that occur during the request to 'http://invalid.url'.

const hyperquest = require('hyperquest');

const req = hyperquest('http://invalid.url');
req.on('error', (err) => {
  console.error('Request failed:', err);
});

Other packages similar to hyperquest

Keywords

FAQs

Package last updated on 23 Jan 2018

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