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

rev-log-worker

v1.0.4

Published

Middleware de logging HTTP com compressão, criptografia e envio via HTTP ou socket.

Downloads

14

Readme

✅ README.md

rev-log-worker

Middleware de logging HTTP para aplicações Express, com suporte a:

  • Compressão GZIP
  • Criptografia RSA + AES opcional
  • Envio via Socket.IO ou HTTP POST
  • Formato de log detalhado da requisição e resposta
  • Suporte a arquivos e formulários (form-data)

📦 Instalação

npm install rev-log-worker

🚀 Uso

const express = require('express');
const createLogMiddleware = require('rev-log-worker');

const app = express();

app.use(createLogMiddleware({
  justRequest: false, // true = só HTTP POST, false = também socket se for log leve
  isCrypt: true, // true = criptografa os logs com RSA+AES
  socketUrl: 'http://localhost:4000', // URL do servidor de socket.io
  apiUrl: 'https://meu-api.com/logs', // URL para envio via POST
  publicKeyPem: '-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqh...', // Chave pública em PEM
  clientName: 'my-app-name' // Identificação do cliente
}));

⚙️ Opções

| Opção | Tipo | Padrão | Descrição | |-------|------|--------|-----------| | justRequest | boolean | true | Se true, envia só via HTTP; se false e log for leve, envia via socket | | isCrypt | boolean | true | Ativa criptografia com RSA + AES | | socketUrl | string | 'http://localhost:4000' | URL para conexão Socket.IO | | apiUrl | string | 'https://webhook.site/...' | URL de fallback/envio HTTP | | publicKeyPem | string | undefined | Chave pública RSA para criptografar (obrigatória se isCrypt=true) | | clientName | string | 'unknown' | Nome do cliente para identificação |

📄 Formato do Log

O log contém informações completas da requisição e resposta, incluindo:

  • headers, body, arquivos (upload), tempo de resposta
  • IP, URL, método, sessão, user-agent

Enviado como objeto JSON (com ou sem criptografia)

🔐 Criptografia

Se isCrypt for true, o payload será criptografado com AES-128-CBC e a chave AES com a chave pública RSA fornecida (PEM).

💡 Exemplo de envio via Socket.IO

Certifique-se de que o servidor de destino escute o evento http-log:

io.on('connection', (socket) => {
  socket.on('http-log', (log) => {
    console.log('Log recebido:', log);
  });
});

📤 Exemplo de payload HTTP

{
  "encryptedKey": "...",
  "iv": "...",
  "encryptedData": "...",
  "client": "my-app-name"
}

🪪 Licença

MIT © 2025 Davi