npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2025 – Pkg Stats / Ryan Hefner

requestify.js

v2.2.0

Published

πŸš€ Π›Ρ‘Π³ΠΊΠΈΠΉ ΠΈ Ρ€Π°ΡΡˆΠΈΡ€ΡΠ΅ΠΌΡ‹ΠΉ HTTP-ΠΊΠ»ΠΈΠ΅Π½Ρ‚ с ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠΎΠΉ middleware для JavaScript ΠΈ TypeScript

Downloads

17

Readme

πŸš€ Requestify.js

npm version License: MIT TypeScript

Π›Ρ‘Π³ΠΊΠΈΠΉ ΠΈ Ρ€Π°ΡΡˆΠΈΡ€ΡΠ΅ΠΌΡ‹ΠΉ HTTP-ΠΊΠ»ΠΈΠ΅Π½Ρ‚ с ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠΎΠΉ middleware для JavaScript ΠΈ TypeScript ΠΏΡ€ΠΎΠ΅ΠΊΡ‚ΠΎΠ².

✨ ΠžΡΠΎΠ±Π΅Π½Π½ΠΎΡΡ‚ΠΈ

  • πŸ”§ Гибкая систСма middleware - ΠΏΠ΅Ρ€Π΅Ρ…Π²Π°Ρ‚Ρ‹Π²Π°ΠΉΡ‚Π΅ ΠΈ ΠΌΠΎΠ΄ΠΈΡ„ΠΈΡ†ΠΈΡ€ΡƒΠΉΡ‚Π΅ запросы ΠΈ ΠΎΡ‚Π²Π΅Ρ‚Ρ‹
  • πŸ›‘οΈ Полная типизация TypeScript - Π°Π²Ρ‚ΠΎΠ΄ΠΎΠΏΠΎΠ»Π½Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΊΠ° Ρ‚ΠΈΠΏΠΎΠ²
  • πŸš€ Π‘ΠΎΠ²Ρ€Π΅ΠΌΠ΅Π½Π½Ρ‹ΠΉ API - основан Π½Π° Fetch API
  • πŸ“¦ ΠœΠΈΠ½ΠΈΠΌΠ°Π»ΡŒΠ½Ρ‹ΠΉ Ρ€Π°Π·ΠΌΠ΅Ρ€ - Π±Π΅Π· Π»ΠΈΡˆΠ½ΠΈΡ… зависимостСй
  • 🎯 ΠŸΡ€ΠΎΡΡ‚ΠΎΡ‚Π° использования - ΠΈΠ½Ρ‚ΡƒΠΈΡ‚ΠΈΠ²Π½Ρ‹ΠΉ API

πŸ“¦ Установка

npm install requestify.js

πŸš€ Быстрый старт

Π‘Π°Π·ΠΎΠ²ΠΎΠ΅ использованиС

import { HttpClient } from 'requestify.js';

const api = new HttpClient({
	baseUrl: 'https://api.example.com'
});

// GET запрос
const data = await api.get('/users');

// POST запрос
const newUser = await api.post('/users', {
	name: 'John',
	email: '[email protected]'
});

Π‘ middleware

import { HttpClient } from 'requestify.js';
import { jsonMiddleware, retryMiddleware } from 'requestify.js';

const api = new HttpClient({
	baseUrl: 'https://api.example.com'
})
	.registerMiddleware(jsonMiddleware)
	.registerMiddleware(retryMiddleware(3));

// АвтоматичСски парсит JSON ΠΈ повторяСт Π½Π΅ΡƒΠ΄Π°Ρ‡Π½Ρ‹Π΅ запросы
const users = await api.get('/users');

πŸ”§ Middleware

Π‘Ρ‚Π°Π½Π΄Π°Ρ€Ρ‚Π½Ρ‹Π΅ middleware

import { jsonMiddleware, jsonFormatMiddleware, retryMiddleware } from 'requestify.js';

// АвтоматичСскоС ΠΏΡ€Π΅ΠΎΠ±Ρ€Π°Π·ΠΎΠ²Π°Π½ΠΈΠ΅ Π² JSON
const api1 = new HttpClient().registerMiddleware(jsonMiddleware);

// Π€ΠΎΡ€ΠΌΠ°Ρ‚ΠΈΡ€ΠΎΠ²Π°Π½Π½Ρ‹ΠΉ ΠΎΡ‚Π²Π΅Ρ‚ с ΠΌΠ΅Ρ‚Π°Π΄Π°Π½Π½Ρ‹ΠΌΠΈ
const api2 = new HttpClient().registerMiddleware(jsonFormatMiddleware);

// ΠŸΠΎΠ²Ρ‚ΠΎΡ€Π΅Π½ΠΈΠ΅ Π½Π΅ΡƒΠ΄Π°Ρ‡Π½Ρ‹Ρ… запросов
const api3 = new HttpClient().registerMiddleware(retryMiddleware(3));

Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ собствСнного middleware

import { defineMiddleware } from 'requestify.js';

const authMiddleware = defineMiddleware({
	name: 'auth',
	before: async config => {
		config.headers = {
			...config.headers,
			Authorization: 'Bearer your-token'
		};
		return config;
	}
});

const api = new HttpClient().registerMiddleware(authMiddleware);

πŸ“š ДокумСнтация

Полная докумСнтация доступна Π½Π° GitHub Pages.

🀝 ΠŸΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ°

πŸ“„ ЛицСнзия

MIT License - см. LICENSE Ρ„Π°ΠΉΠ» для Π΄Π΅Ρ‚Π°Π»Π΅ΠΉ.

πŸ‘¨β€πŸ’» Автор

Igor Koneshov


⭐ Если ΠΏΡ€ΠΎΠ΅ΠΊΡ‚ Π²Π°ΠΌ понравился, ΠΏΠΎΡΡ‚Π°Π²ΡŒΡ‚Π΅ Π·Π²Π΅Π·Π΄Ρƒ Π½Π° GitHub!