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

logarc

v0.0.2

Published

LogArc Package For Node Js

Downloads

8

Readme

LogArc

This npm package allows you to integrate logarc on your NodeJs Application.

Quick Start

Install Using Npm

npm i logarc

Usage

// Import the LogArcService and AppEnv enum
const { LogArcService, AppEnv } = require("logarc");

// Initialize the logger
const logger = new LogArcService(
  {
    project_key: "your-project-key",        // Required
    endpoint: "https://logarc.com/api",     // Optional (defaults to LogArc endpoint)
    env: AppEnv.DEVELOPMENT,                // One of: local, development, staging, production
    timezone: "Asia/Kathmandu",             // Optional (defaults to UTC)
  },
  { id: 1, name: "Dipesh" }                 // Optional user object
);

// Log different levels
logger.debug("Debugging something", { foo: "bar" });
logger.info("Informational message");
logger.warning("This is a warning");
logger.error("Something went wrong", { error: "details" });
logger.critical("Critical failure in system");
logger.alert("Immediate action required!");
logger.emergency("Emergency! System down!");

Log Levels Reference

| Method | Level | Description | |---------------|-----------|-----------------------------------------| | debug() | debug | Detailed information for debugging | | info() | info | General informational messages | | notice() | notice | Normal but significant events | | warning() | warning | Potential issues that need attention | | error() | error | Runtime errors or exceptions | | critical() | critical | Critical conditions | | alert() | alert | Requires immediate action | | emergency() | emergency | System is unusable or in a severe state |

Possible Errors & How to Handle Them

ProjectKeyNotFoundException

  • Cause: project_key is missing in the config.
  • Fix: Make sure to pass project_key when initializing LogArcService:
    const logger = new LogArcService({ project_key: "your-key" });

InvalidProjectKeyException

  • Cause: Server responded with 422, meaning the project key is invalid.
  • Fix: Verify your project key is correct and active on the LogArc dashboard. Catch the error if needed:
      try {
            logger.info("Test log");
        } catch (err) {
            if (err.name === "InvalidProjectKeyException") {
                console.error("Invalid project key! Check your configuration.");
            }
        }

Network/Connection Errors

  • Cause: Unable to reach the LogArc server (timeout, DNS, or offline).
  • Fix: Ensure your server can access the endpoint and retry if necessary:
    try {
      logger.debug("Testing connection");
    } catch (err) {
      console.error("Failed to send log:", err.message);
    }

Invalid Environment

  • Cause: env is not one of the allowed values (local, development, staging, production).
  • Fix: Use the AppEnv enum to set your environment:
    const logger = new LogArcService({ project_key: "your-key", env: AppEnv.DEVELOPMENT });

License

MIT

Author

Support

For support, email dipeshkhanal79[at]gmail[dot]com.