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

@big-brains/kendra

v0.0.4

Published

Lightweight utilities which at the kendra!

Downloads

6

Readme

UNDER DEVELOPMENT: NOT READY FOR PRODUCTION.

Environment variables:

  • MONGO: If you want to use mongodb.
  • KENDRA: RabbitMq or any ampq compitible queue connection string.
  • LOG_LEVEL: Logging level, default: 4.
  • LOG_EXCHANGE: Exchange to which the logs must be published. Default: logs (no warning is shown if not provided.)

usage:

const kendra = require('@big-brains/kendra');

kendra('component-or-service-name')
.then(({ 
    rpc: { 
        on,
        call,
        broadcast,
        newsOn
    },
    log: {
        get
    },
    dbAction
  }) => {
      
      const {
        trace,
        debug,
        info,
        warn,
        error,
        fatal, 
      } = get('subcomponent-or-subsection-name');

      // DO YOUR THING!
  });

A word on log level

  RANK Level  Description
  6    TRACE  Designates finer-grained informational events than the DEBUG.
  5    DEBUG  Designates fine-grained informational events that are most
              useful to debug an application.
  4    INFO   Designates informational messages that highlight the progress
              of the application at coarse-grained level.
  3    WARN   Designates potentially harmful situations.
  2    ERROR  Designates error events that might still allow the application to continue running.
  1    FATAL  Designates very severe error events that will presumably lead the application to abort.
  0    OFF    The highest possible rank and is intended to turn off logging.
  
  TRACE < DEBUG < INFO < WARN < ERROR < FATAL < OFF
  
  Example:
  If log level is set to 4, then FATAL, ERROR, WARN and INFO are enabled. 
  Same way, if log level is set to 2, then FATAL and ERROR are enabled.

usage (log):

/* Assume its just below DO YOUR THING! (see above usage example) */

trace('message in string', { any: { mata: 'data can go here' }});

Error index:

FATAL

  • 100: Set KENDRA environment variable to RabbitMq or any ampq compitible queue connection string to initialize kendra. Exiting.
  • 101: Set MONGO environment variable to use dbAction. Exiting.
  • 102: Some error in module initialization state machine. Exiting.

(above errors will not be available on ampq logs.)

  • 103: MONGO MUST have a connection string with inline db, db MUST provided at {{db}}. Eg. mongodb://127.0.0.1:27017/{{db}}

ERROR

  • 200: Failed to execute dbAction (along with actual error)

WARN

  • 300: LOG_LEVEL environment variable unset. Default log level set to 4 (info)
  • 301: Connection was closed. New connection will be created in next attempt. All happened because of

INFO

  • 401: New connection created

Happy coding!