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

@jitesoft/yolog-json-plugin

v1.1.6

Published

Plugin for @jitesoft/yolog to output logs as JSON.

Downloads

39

Readme

Yolog JSON Plugin

npm (scoped) Known Vulnerabilities pipeline status coverage report npm Back project

Plugin for the @jitesoft/yolog logger create logs in json format.
When running in the browser, all the data will be printed to the console, while, when using the nodejs version the data can either be pushed to a file or to the stdout/stderr of the application.

Usage:

Install with your favorite package manager!

npm i @jitesoft/yolog-json-plugin --save
yarn add @jitesoft/yolog-json-plugin

Import and use just as with any other yolog plugin!

import logger from '@jitesoft/yolog';
import JsonPlugin from '@jitesoft/yolog-json-plugin';
logger.addPlugin(new JsonPlugin('file.txt'));

To import it in a browser environment, the src/browser (or /dist/browser for precompiled) suffix have to be added:

import logger from '@jitesoft/yolog';
import JsonPlugin from '@jitesoft/yolog-json-plugin/src/browser';
logger.addPlugin(new JsonPlugin()); // No file!

Data format

Each line in the output is a single JS Object notation, that is, the full file is not an array of json objects, but each line should be parsed as its own.

Example:

{"tag": "emergency", "timestamp": 123123123, "message": "abc123!!", "error":  { "message": "error message!", "stack": [ "callstack here." ] }}
{"tag": "warning", "timestamp": 123123124, "message": "abc123"}

That means that when parsing the file (or output), each line should be parsed as its own object.