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

@704app/pulse

v1.1.0

Published

Automatic error tracking SDK for Node.js and Browser

Downloads

194

Readme

@704app/pulse

Automatic error tracking SDK for Node.js and Browser.

Instalação

npm install @704app/pulse
# ou
yarn add @704app/pulse
# ou
pnpm add @704app/pulse

Uso

Opção 1: Inicialização Manual

Importe e configure o Pulse manualmente:

import { Pulse } from '@704app/pulse';

// Inicializar com configuração manual
Pulse.init({
  app: 'billing-api',
  groupId: 'payments'
});

// Agora o Pulse está ativo e captura automaticamente:
// - Erros não tratados (uncaughtException, unhandledRejection)
// - Erros do console.error()
// - Erros do browser (window.error, unhandledrejection)

Opção 2: Inicialização Automática via Variáveis de Ambiente

Para inicialização automática, importe o módulo auto:

// No início do seu arquivo principal
import '@704app/pulse/auto';

E configure as variáveis de ambiente:

# .env ou variáveis de ambiente do sistema
PULSE_APP=billing-api
PULSE_GROUP=payments

Opção 3: Inicialização Manual com Variáveis de Ambiente

import { Pulse } from '@704app/pulse';

// Lê automaticamente PULSE_APP e PULSE_GROUP do process.env
Pulse.initFromEnv();

Exemplos de Uso

Node.js

// app.js
import { Pulse } from '@704app/pulse';

Pulse.init({
  app: 'my-api',
  groupId: 'backend'
});

// O Pulse captura automaticamente:
// - Erros não tratados
// - Promises rejeitadas sem tratamento
// - console.error()

// Você também pode enviar logs manuais de emergência:
try {
  // seu código
} catch (error) {
  Pulse.emergency(error, 'custom.context');
}

Browser

// main.js
import { Pulse } from '@704app/pulse';

Pulse.init({
  app: 'my-frontend',
  groupId: 'web'
});

// O Pulse captura automaticamente:
// - Erros do window (window.error)
// - Promises rejeitadas (unhandledrejection)
// - console.error()

// Log manual de emergência:
try {
  // seu código
} catch (error) {
  Pulse.emergency(error, 'user-action');
}

Com Variáveis de Ambiente (Node.js)

// app.js - início do arquivo
import '@704app/pulse/auto';

// Resto do seu código...
// O Pulse será inicializado automaticamente se PULSE_APP e PULSE_GROUP estiverem definidos
# .env
PULSE_APP=my-api
PULSE_GROUP=backend

API

Pulse.init(config)

Inicializa o Pulse com configuração manual.

Parâmetros:

  • config.app (string): Nome da aplicação
  • config.groupId (string): ID do grupo

Pulse.initFromEnv()

Inicializa o Pulse lendo PULSE_APP e PULSE_GROUP de process.env. Funciona apenas em Node.js.

Pulse.emergency(error, context?)

Envia um log manual de emergência.

Parâmetros:

  • error (any): O erro ou objeto a ser logado
  • context (string, opcional): Contexto do erro (padrão: 'manual.emergency')

O que é capturado automaticamente?

  • ✅ Erros não tratados (uncaughtException)
  • ✅ Promises rejeitadas (unhandledRejection)
  • ✅ Erros do console.error()
  • ✅ Erros do browser (window.error)
  • ✅ Logs manuais via Pulse.emergency()

Requisitos

  • Node.js 14+ ou navegador moderno
  • Suporte a ES Modules ou CommonJS