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

vyfetch

v0.3.0

Published

Consume your apis in React projects quickly and easily

Readme

VyFetch - HTTP Client para TypeScript/JavaScript 🚀 (WIP)

VyFetch é uma biblioteca poderosa e extensível para realizar requisições HTTP de forma simplificada, com suporte a interceptadores, sistema de plugins e transformação avançada de respostas usando SuperJSON.

📦 Instalação

pnpm add vyfetch

🚀 Uso Básico

import { vyfetch } from "vyfetch";

const response = await vyfetch("/api/users");
console.log(response);

📌 Recursos Atuais

| Recurso | Descrição | Status | | --------------------- | --------------------------------------------------- | ------ | | ✅ Base URL Global | Define um base URL para requisições | | | ✅ Interceptadores | Permite manipular requisições e respostas | | | ✅ Sistema de Plugins (Beta) | Suporte a extensões personalizadas | | | ✅ Suporte a SuperJSON (Beta) | Transformação avançada de dados | | | ✅ Cache Integrado | Configuração de cache para requisições | | | ✅ Configuração Global | Personalização de opções padrão | |

🔮 Recursos Planejados

| Recurso | Descrição | Status | | ------------------------------- | -------------------------------------- | ------ | | ⏳ Suporte a WebSockets | Comunicação em tempo real | | | ⏳ CLI para Gerenciamento | Ferramenta CLI para configuração | | | ⏳ Suporte a GraphQL | Suporte nativo para GraphQL | | | ⏳ Melhor Gerenciamento de Erros | Novas opções para tratamento de falhas | | | ⏳ Extensibilidade Avançada | Melhorias no sistema de plugins | |

📖 Documentação Completa

Para mais detalhes, acesse a documentação oficial: Em breve


Overview

Vyfetch é um wrapper poderoso para o fetch nativo, que agrega diversas funcionalidades:

  • Configuração Global: Permite definir uma base URL, timeout, headers, interceptadores e callbacks que serão aplicados a todas as requisições.
  • Sistema de Plugins: Possibilita a injeção de lógica customizada em pontos-chave do fluxo de requisição (pré e pós-processamento, tratamento de erros).
  • Integração Opcional com SuperJSON (Beta): Suporta a desserialização de tipos complexos (como Date, Map, Set, BigInt) via flag useSuperJSON ou função transformResponse.
  • Cache, Timeout e Batching: Mecanismos integrados para otimizar performance e evitar requisições duplicadas.

Configurações Globais

import { configure } from 'vyfetch';

configure({
  baseUrl: "https://jsonplaceholder.typicode.com", // URL base para requisições relativas
  timeout: 5000, // Timeout padrão de 5000ms
  cacheOptions: { ttl: 60000 }, // Cache com TTL de 60 segundos
  useSuperJSON: true, // Ativa o uso do SuperJSON para transformações de resposta
  interceptors: {
    request: [
      async (url, options) => {
        options.headers = { ...options.headers, "Authorization": "Bearer TOKEN_GLOBAL" };
        return { url, options };
      },
    ],
  },
  onError: (error) => {
    console.error("Erro global:", error);
  },
});

Suporte SuperJSON

Ative o uso do SuperJSON para transformar a resposta:

vyfetch('/api/data', {
  method: 'GET',
  useSuperJSON: true, // ou use transformResponse: (rawData, response) => SuperJSON.parse(rawData)
});

Referências da API

  • vyfetch<T = any>(url: string, options?: SuperFetchOptions): Promise<SuperFetchResponse> Realiza a requisição HTTP e retorna um objeto contendo:

    • data: Dados transformados da resposta.
    • status: Código de status HTTP.
    • headers: Cabeçalhos da resposta.
    • fromCache: Flag indicando se os dados vieram do cache.
    • duration: Tempo total da requisição (em milissegundos).
    • configure(options: Partial): void
    • Define configurações globais para todas as requisições, incluindo baseUrl, timeout, interceptadores e outras opções.

Criado com 💙 por [@binhodev]