All Projects → ethanent → Phin

ethanent / Phin

Licence: mit
Node HTTP client

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Phin

Http Client
A high-performance, high-stability, cross-platform HTTP client.
Stars: ✭ 86 (-80.85%)
Mutual labels:  http-client, request, https
electron-request
Zero-dependency, Lightweight HTTP request client for Electron or Node.js
Stars: ✭ 45 (-89.98%)
Mutual labels:  https, http-client, request
go-axios
HTTP Request package for golang.
Stars: ✭ 29 (-93.54%)
Mutual labels:  http-client, request
request-extra
⚡️ Extremely stable HTTP request module built on top of libcurl with retries, timeouts and callback API
Stars: ✭ 14 (-96.88%)
Mutual labels:  http-client, request
Netty Http Client
An asynchronous http client in Java, with a clean, callback-based API, using Netty 4.x
Stars: ✭ 295 (-34.3%)
Mutual labels:  http-client, https
Httpdirfs
A filesystem which allows you to mount HTTP directory listings, with a permanent cache. Now with Airsonic / Subsonic support!
Stars: ✭ 443 (-1.34%)
Mutual labels:  http-client, https
servie
Standard, framework-agnostic HTTP interfaces for JavaScript servers and clients
Stars: ✭ 39 (-91.31%)
Mutual labels:  https, request
axios-for-observable
A RxJS wrapper for axios, same api as axios absolutely
Stars: ✭ 13 (-97.1%)
Mutual labels:  http-client, request
restler
Restler is a beautiful and powerful Android app for quickly testing REST API anywhere and anytime.
Stars: ✭ 120 (-73.27%)
Mutual labels:  https, http-client
Gaxios
An HTTP request client that provides an axios like interface over top of node-fetch. Super lightweight. Supports proxies and all sorts of other stuff.
Stars: ✭ 301 (-32.96%)
Mutual labels:  request, npm
Gretchen
Making fetch happen in TypeScript.
Stars: ✭ 301 (-32.96%)
Mutual labels:  http-client, request
Kurly
kurly is an alternative to the widely popular curl program, written in Golang.
Stars: ✭ 319 (-28.95%)
Mutual labels:  http-client, https
centra
Core Node.js HTTP client
Stars: ✭ 52 (-88.42%)
Mutual labels:  http-client, request
net
A small, modern, PSR-7 compatible PSR-17 and PSR-18 network library for PHP, inspired by Go's net package.
Stars: ✭ 16 (-96.44%)
Mutual labels:  https, request
wumpfetch
🚀🔗 A modern, lightweight, fast and easy to use Node.js HTTP client
Stars: ✭ 20 (-95.55%)
Mutual labels:  https, request
http-requests
An HTTP client abstraction that provides a common interface to several different client implementations.
Stars: ✭ 22 (-95.1%)
Mutual labels:  https, http-client
Isahc
The practical HTTP client that is fun to use.
Stars: ✭ 338 (-24.72%)
Mutual labels:  http-client, https
WaterPipe
URL routing framework, requests/responses handler, and HTTP client for PHP
Stars: ✭ 24 (-94.65%)
Mutual labels:  http-client, request
puzzle-warden
🔌 Improved http client with epic features for creating fast and scalable applications.
Stars: ✭ 41 (-90.87%)
Mutual labels:  http-client, request
Jetty.project
Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more
Stars: ✭ 3,260 (+626.06%)
Mutual labels:  http-client, https

phin logo


The lightweight Node.js HTTP client

Full documentation | GitHub | NPM

Simple Usage

const p = require('phin')

const res = await p('https://ethanent.me')

console.log(res.body)

Note that the above should be in an async context! Phin also provides an unpromisified version of the library.

Install

npm install phin

Why Phin?

Phin is relied upon by important projects and large companies. The hundreds of contributors at Less, for example, depend on Phin as part of their development process.

Also, Phin is very lightweight. To compare to other libraries, see Phin vs. the Competition.

Quick Demos

Simple POST:

await p({
	url: 'https://ethanent.me',
	method: 'POST',
	data: {
		hey: 'hi'
	}
})

Unpromisified Usage

const p = require('phin').unpromisified

p('https://ethanent.me', (err, res) => {
	if (!err) console.log(res.body)
})

Simple parsing of JSON:

// (In async function in this case.)

const res = await p({
	'url': 'https://ethanent.me/name',
	'parse': 'json'
})

console.log(res.body.first)

Default Options

const ppostjson = p.defaults({
	'method': 'POST',
	'parse': 'json',
	'timeout': 2000
})

// In async function...

const res = await ppostjson('https://ethanent.me/somejson')
// ^ An options object could also be used here to set other options.

// Do things with res.body?

Custom Core HTTP Options

Phin allows you to set core HTTP options.

await p({
	'url': 'https://ethanent.me/name',
	'core': {
		'agent': myAgent // Assuming you'd already created myAgent earlier.
	}
})

Full Documentation

There's a lot more which can be done with the Phin library.

See the Phin documentation.

Phin vs. the Competition

Phin is a very lightweight library, yet it contains all of the common HTTP client features included in competing libraries!

Here's a size comparison table:

Package Size
request request package size
superagent superagent package size
got got package size
axios axios package size
isomorphic-fetch isomorphic-fetch package size
r2 r2 package size
node-fetch node-fetch package size
phin phin package size
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].