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

hecatonchires

v0.0.5

Published

Massive Out of band logging.

Downloads

4

Readme

HECATONCHIRES

Logging sucks. It gets in the way of fast responses and forces you to dig through and deal with file APIs and other nonsense. Don't do that - do this instead.

API

To quickly log some information to a useful file:

require('hecatonchires').log("debug", null, "INFO", "I'm Mr. Meeseeks, look at me!");

You can keep like things identifiable in the logs with identifiers:

require('hecatonchires').log("debug", "Beth", "INFO", "Horse Surgeons are just as valuable as regular surgeons");

For later references, that's:

log(type, id, level, message);

Have tons of different things being operated on in highly asynchronouse fashion? Of course you do!

request.logger = new require('hecatonchires').logger();

... Elsewhere...

request.logger.log("error", "WARNING", "Oh man, Rick! I'm looking around this place and I'm starting to work up some anxiety about this whole thing!"

... In yet another place...

request.logger.log("unexpected", "CRITICAL ERROR", "HOLY CRAP, MORTY, RUN!")

Loggers will generate their own ID and keep to it.

Stop all logging behaviour with

require('hecatonchires').stop();

But all those logs will build up in memory. Try to write them all later with

require('hecatonchires').start();

Behaviour

Each message will be placed in <type>.log, prefixed with the date at which it was logged, its ID, and the level at which it was logged.

You can configure the directory in which the logs are stored by setting HECATONCHIRES_LOG_DIR in your environment.

You can configure the length of the random ID in which the logs are stored by setting HECATONCHIRES_ID_LENGTH in your environment.

Dropping

Logs will be dropped if the logger falls too far behind because your server is overworked based on their level. INFO level logs will be dropped most aggressively, followed by WARNING, ERROR, and in extreme cases, CRITICAL ERROR. Unrecognized levels can be logged, but they will be dropped as if they were INFO level.

To stop dropping behaviour, set HECTONCHIRES_NEVER_DROP to a truthy value.