All Projects → terkelg → hent

terkelg / hent

Licence: MIT license
A small utility to fetch remote files into buffers

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to hent

miniprogram-network
Redefine the Network API of Wechat MiniProgram (小程序网络库)
Stars: ✭ 93 (+304.35%)
Mutual labels:  fetch, download, request
wumpfetch
🚀🔗 A modern, lightweight, fast and easy to use Node.js HTTP client
Stars: ✭ 20 (-13.04%)
Mutual labels:  fetch, request, get
Github Files Fetcher
Download a specific folder or file from a GitHub repo through command line
Stars: ✭ 73 (+217.39%)
Mutual labels:  fetch, files, download
Composable Fetch
A library that brings composition to http requests & solves most common tasks
Stars: ✭ 23 (+0%)
Mutual labels:  fetch, request
Ky Universal
Use Ky in both Node.js and browsers
Stars: ✭ 421 (+1730.43%)
Mutual labels:  fetch, request
Ky
🌳 Tiny & elegant JavaScript HTTP client based on the browser Fetch API
Stars: ✭ 7,047 (+30539.13%)
Mutual labels:  fetch, request
electron-request
Zero-dependency, Lightweight HTTP request client for Electron or Node.js
Stars: ✭ 45 (+95.65%)
Mutual labels:  fetch, request
Frisbee
🐕 Modern fetch-based alternative to axios/superagent/request. Great for React Native.
Stars: ✭ 1,038 (+4413.04%)
Mutual labels:  fetch, request
Create Request
Apply interceptors to `fetch` and create a custom request function.
Stars: ✭ 34 (+47.83%)
Mutual labels:  fetch, request
Redux Query
A library for managing network state in Redux
Stars: ✭ 1,055 (+4486.96%)
Mutual labels:  fetch, request
Apipeline
Feature-rich and pluggable offline-first API wrapper for all your javascript environements ! Easily wire-up your API and make your app work offline in minutes.
Stars: ✭ 92 (+300%)
Mutual labels:  fetch, request
React Request
Declarative HTTP requests for React
Stars: ✭ 340 (+1378.26%)
Mutual labels:  fetch, request
Gretchen
Making fetch happen in TypeScript.
Stars: ✭ 301 (+1208.7%)
Mutual labels:  fetch, request
Ngx Restangular
Restangular for Angular 2 and higher versions
Stars: ✭ 787 (+3321.74%)
Mutual labels:  fetch, request
Trae
📮 Minimalistic Fetch based HTTP client
Stars: ✭ 257 (+1017.39%)
Mutual labels:  fetch, request
Wretch Middlewares
Collection of middlewares for the Wretch library. 🎁
Stars: ✭ 42 (+82.61%)
Mutual labels:  fetch, request
Mfetch
mfetch will provide you with a strong ability to request resource management
Stars: ✭ 90 (+291.3%)
Mutual labels:  fetch, request
Use Http
🐶 React hook for making isomorphic http requests
Stars: ✭ 2,066 (+8882.61%)
Mutual labels:  fetch, request
vue-methods-promise
Let Vue methods support return Promise
Stars: ✭ 35 (+52.17%)
Mutual labels:  fetch, request
Wretch
A tiny wrapper built around fetch with an intuitive syntax. 🍬
Stars: ✭ 2,285 (+9834.78%)
Mutual labels:  fetch, request

hent build status codecov

Tiny utility to fetch remote files into buffers

hent is a small, promise based, utility to download remote files into nodejs buffers. Protocol and redirects are automatically handled for you.

Features

  • Promise based
  • Supports HTTP and HTTPS protocols
  • Follow redirects
  • Dependency free

Additionally, this module is delivered as:

Install

$ npm install --save hent

Usage

import hent from 'hent';

const {buffer} = await hent('https://example.com/dog.jpeg');

// access response object
const {res, buffer} = await hent('https://example.com/cat.png');

// that's it!

API

hent(url, [opts])

Returns: Promise <Object>

The returned object has two properties: buffer and res.

  • buffer is the downloaded file as a Buffer.
  • res is the node response used to access response status, headers and data.

fyi: hent is a danish word and means fetch.

url

Type: String

URL to the resource you want to download.
Protocol is automatically detected.

opts

Type: Object

Optional options object passed to http.get. Use this to define custom headers etc.

License

MIT © Terkel Gjervig

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].