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

miniget

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

miniget

A small HTTP(S) GET request library, with redirects and streaming.

  • 1.7.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is miniget?

miniget is a lightweight HTTP request library for Node.js, primarily used for making simple GET requests. It is designed to be minimalistic and easy to use, focusing on simplicity and performance.

What are miniget's main functionalities?

Basic GET Request

This feature allows you to make a basic GET request to a specified URL and handle the response as text. The code sample demonstrates how to fetch a JSON object from a placeholder API and log it to the console.

const miniget = require('miniget');

miniget('https://jsonplaceholder.typicode.com/todos/1').text().then(console.log).catch(console.error);

Stream Response

This feature allows you to stream the response directly to a writable stream, such as a file. The code sample demonstrates how to fetch a JSON object from a placeholder API and save it to a file named 'response.json'.

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

miniget('https://jsonplaceholder.typicode.com/todos/1').pipe(fs.createWriteStream('response.json'));

Custom Headers

This feature allows you to specify custom headers for your GET request. The code sample demonstrates how to set a custom 'User-Agent' header when making a request to a placeholder API.

const miniget = require('miniget');

const options = {
  headers: {
    'User-Agent': 'my-custom-agent'
  }
};

miniget('https://jsonplaceholder.typicode.com/todos/1', options).text().then(console.log).catch(console.error);

Other packages similar to miniget

Keywords

FAQs

Package last updated on 26 May 2020

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