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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@apisight/node

v1.1.12

Published

Agente oficial do ApiSight para Node.js — monitore erros, requisições e métricas da sua API em tempo real.

Readme

🧠 @apisight/node

Observabilidade e monitoramento de APIs com zero configuração. Capture erros, requisições, métricas e falhas em tempo real. Parte do ecossistema ApiSight.

🚀 Instalação npm install @apisight/node

ou com Yarn:

yarn add @apisight/node

⚙️ Configuração básica

No seu servidor Express, importe e inicialize o agente com a chave JWT gerada no portal ApiSight .

import createAgent from '@apisight/node'; import express from 'express';

const app = express();

// Inicializa o agente const agent = createAgent({ key: 'SEU_JWT_DO_PORTAL' });

// Adiciona o middleware de monitoramento app.use(agent.middleware());

// Adiciona o middleware de captura de erros app.use(agent.errorHandler());

// Exemplo de rota app.get('/ping', (req, res) => { res.send({ message: 'pong' }); });

// Simula um erro app.get('/error', (req, res) => { throw new Error('Falha simulada'); });

app.listen(3000, () => console.log('Servidor rodando na porta 3000 🚀'));

💡 Recursos automáticos

✅ Captura de erros — todos os erros não tratados (exceptions, rejections) ✅ Monitoramento de requests — método, rota, corpo e resposta ✅ Persistência offline — armazena eventos localmente se estiver sem conexão ✅ Retry automático — reenfileira logs quando o servidor estiver offline ✅ Sanitização de dados — remove campos sensíveis (password, token, creditCard) ✅ Métricas embutidas — tempo médio de flush, total de eventos, erros enviados, etc. ✅ Integração transparente — não quebra o fluxo da sua API ✅ Compatível com TypeScript e ESM

🪄 Notificação manual

Você também pode enviar eventos customizados diretamente com agent.notify():

try { // algum código perigoso } catch (err) { agent.notify(err); // envia o erro para o ApiSight }

Se quiser vincular a um request específico:

app.post('/users', async (req, res) => { try { // lógica } catch (err) { agent.notify(err, req); // inclui método, rota e body } });

📊 Métricas em tempo real

Você pode acessar métricas internas do agente para exibir no painel do seu app:

console.log(agent.getMetrics());

Exemplo de retorno:

{ "totalEvents": 42, "errorsSent": 10, "errorsFailed": 2, "avgFlushTimeMs": 120, "flushCount": 5 }

🧱 Estrutura interna

O agente mantém um buffer local (/tmp/agent-buffer.json ou similar), e envia os logs periodicamente para o collector oficial:

https://apisight.vercel.app/api/ingest

Se a API estiver offline, o agente:

salva os eventos em disco;

tenta reenviar automaticamente com exponential backoff;

nunca interrompe o funcionamento da sua aplicação.

🧩 API Método Descrição agent.middleware() Middleware de captura de requisições agent.errorHandler() Middleware de captura de erros agent.notify(error, req?) Envia manualmente um erro agent.getMetrics() Retorna métricas internas agent._flush() Força envio imediato (útil para testes) 🔒 Segurança

A lib não funciona sem chave válida (JWT) gerada no portal ApiSight .

Os dados são enviados apenas para o domínio oficial apisight.vercel.app.

Todos os payloads são sanitizados automaticamente, removendo tokens e informações sensíveis.

🧭 Roadmap

Dashboard de métricas em tempo real

Suporte a gRPC, Fastify e Koa

Integração com React Native e Python SDK

Alertas customizáveis (via e-mail ou webhook)

🧑‍💻 Autor

Mayko Douglas dos Santos Silva Criador do ApiSight

MIT License © 2025

❤️ Contribuição

Quer contribuir? Envie um PR ou abra uma issue no GitHub oficial (em breve público).