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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nudjur/js-logger

v0.0.10

Published

To add structured logs in your node project

Downloads

6

Readme

jslogger

Logging javascript logs to server

Usage

You can install the jslogger using

npm install @nudjur/js-logger

Once installed you can import it as below in your js file

import jsLogger from "@nudjur/js-logger";

export const log = new jsLogger({
  url: <URL>,
  mode: <MODE>
  time_ms: <TIME_MS>
});

Configuration

  1. url: The backend url where jslogger should send logs
  2. mode: Backend url run on different modes such as DEBUG, INFO where if it is DEBUG mode will write debug logs such as click event
  3. time_ms: jslogger store all logs in localstorage and keeps checking if logs present and push it so we can configure the frequency by this args default: 5sec
  4. maxLogs: jslogger will have a threshold that once a count of logs comes to localstorage it will start pushing we can adjust using this default : 1000

Contributing Guideline

To contribute to the repo you clone the repo and create a new branch and start making changes in src/index.js.

  1. Once you are done making changes do update the package.json
version: "0.0.2" => "0.0.3"
  1. After updating version we will need to build also we can do that by using
npm run build
  1. After this we can push all changes to branch and assign the maintainer for review

  2. Once pr is merged maintainer will have to release to npm he can do so by

npm publish --access public

NOTE:- We will need to be logged in node repo for nudjur

Server side

  • The logs will be logged via axios call in post method with a variable logs. The server side script should be able to take the request with argument logs. Below is a example of form data for ajax call.
{
log:[
        {
        UUID: '181393b0-8702-11e7-9ca6-a7e5a0572c550.8393907533887879', //sortable unique number
        level : info/log/debug/error/user message/warn/exception/ajax,
        message: 'message',
        user: 'user if specified',
        url: 'url where log happened',
        host_url: 'host url(domain)',
        misc: 'any extra data user specifies that is used while logging'
        },
        {}, {}, ....
    ]
}