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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@wpefintech/client-logger

v1.0.6

Published

javascript client logger

Readme

Client Logger

This library contains 2 package both for client side and server side of your application.

Basic Usage

Here are the steps to start using this package.

Client

For initiation on the client side of your application, here's the one that you'll need to do:

import { initLogger } from '@wpefintech/client-logger/dist/client';

try {
    initLogger({
        enable: true, // enable the client logger
        enableEventImmediately: true, // enable error event
        endpoint: '/logging', // endpoint to send the error event throught http request
        serviceName: 'your-service-name', // your service name
    });
} catch (err) {
    console.error('[InitLogger] error when init logger');
}

If the initiation succesfull, all console.error and window unhandledrejection, error event will be automatically captured and send to the endpoint after 5s (you can change this with waitTime option when initLogger).

Server

And for the server-side (now we're only support for Express), you can attach the router package to do the logging.

import express from 'express';
import { logRouterHandler } from '@wpefintech/client-logger/dist/server';

const logRouter = logRouterHandler('/var/log/your-service'); // the argument that passed here is the path to your log files would be located.

const app = express();
const PORT = 3000;
app.post('/logging', logRouter); // endpoint for logging
app.listen(PORT, () => console.log(`Express running on port ${PORT}`));

Examples

You can see the simple example folder for the basic usage of this package. And here's the example for the result log file:

{"level":"error","time":"12/17/2020, 5:21:27 PM","pid":68624,"hostname":"BA-0000XXXX.local","ID":"071f3f160bff4defb8114b666059dbd2","service":"test-service","message":"test 1000","type":"console.error","userAgent":"Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Mobile Safari/537.36","referrer":"","timestamp":"12/17/2020, 5:21:22 PM","href":"http://localhost:5000/","messages":["test 1000"],"v":1}