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

lo99er

v1.0.8

Published

A log library integrate with elasticsearch

Readme

Lo99er

Lo99er é uma biblioteca npm para captura de logs de aplicações Node.js e envio direto para o Elasticsearch.

O objetivo é centralizar eventos de info, success, warn e error em um índice único para facilitar a montagem de dashboards, busca e observabilidade dos serviços que consumirem o pacote.

Arquitetura

Fluxo principal

  1. A aplicação consumidora chama info, success, warn ou error.
  2. A biblioteca monta um objeto de log com:
    • service_name
    • service_version
    • appKey
    • message
    • route
    • data
    • header
    • timestamp
    • severity
  3. O log é enviado ao Elasticsearch.
  4. O documento é indexado em search-logs.

Integrações

  • Elasticsearch 8.x
  • Variáveis de ambiente carregadas por dotenv

Funcionalidades

  • info(data): registra logs informativos.
  • success(data): registra logs de sucesso.
  • warn(data): registra logs de alerta.
  • error(data): registra logs de erro.
  • Persistência automática no Elasticsearch.
  • Inclusão automática de timestamp e severity.

Requisitos

  • Configurar conexão com Elasticsearch via variáveis de ambiente.
  • Disponibilizar LO99ER_SERVICE_NAME, LO99ER_SERVICE_VERSION, LO99ER_APP_KEY, LO99ER_ELASTIC_SERVER, LO99ER_ELASTIC_USER e LO99ER_ELASTIC_PHRASE.
  • Manter compatibilidade com aplicações Node.js que consumam CommonJS.

Operacionais

  • O Elasticsearch precisa estar acessível a partir da aplicação consumidora.
  • O índice search-logs deve existir ou aceitar criação automática no ambiente.

Regras de Negócio

  • Toda chamada grava o log no Elasticsearch antes de retornar o objeto criado.
  • O campo severity é definido pela biblioteca e não pelo consumidor.
  • O campo timestamp é gerado internamente com new Date().getTime().
  • O documento final é ajustado para usar @timestamp antes do envio.
  • Falhas de persistência são tratadas com catch, mas não há retentativa explícita.
  • A biblioteca usa o mesmo client de Elasticsearch compartilhado entre as chamadas.

Como usar

Instalação

npm install lo99er

Configuração

Crie um arquivo .env no projeto consumidor:

LO99ER_SERVICE_NAME=meu-servico
LO99ER_SERVICE_VERSION=1.0.0
LO99ER_APP_KEY=chave-do-servico
LO99ER_ELASTIC_SERVER=https://localhost:9200
LO99ER_ELASTIC_USER=elastic
LO99ER_ELASTIC_PHRASE=minha-senha

Exemplo de uso

const logger = require('lo99er');

async function executar() {
  await logger.info({
    message: 'Requisição recebida',
    route: '/orders',
    data: JSON.stringify({ orderId: 123 }),
    header: JSON.stringify({ 'x-request-id': 'abc-123' })
  });
}

executar();

Observação

Este projeto não expõe endpoints HTTP nem rotas de frontend. Ele funciona como biblioteca de logging para aplicações Node.js.