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

@cob/dashboard-info

v3.12.0

Published

`@cob/dashboard-info` is a library of functions to get dashboard information from a CoB server.

Downloads

140

Readme

What is @cob/dashboard-info

@cob/dashboard-info is a library of functions to get dashboard information from a CoB server.

Dashboard information is typically frequently requested, periodically updated and aggregated information. These functions are:

  • easy to use
  • minimal footprint with increased code readibility
  • fast initial responses
  • auto updated information

Each function takes care of caching, pooling and syncronizing diferent agents for the same info.

How to install

In your project directory run:

 npm i @cob/dashboard-info

Available functions

The list of available functions are:

  • definitionCount - number of instances for a given query on a definition
  • domainCount - number of instances for a given query on a domain
  • instancesList - array of instances for a given query on a definition
  • fieldSum - sum of values of a field for a given query on definition
  • fieldAverage - average of values of a field for a given query on definition
  • fieldWeightedAverage - weighted average of values of a field, weighted by the values of another field, for a given query on definition
  • fieldValues - array of disctinct values of a field for a given query on a definition

Auxiliary functions that allow you to specify the server and the credential. They should be used just once, in the beginnig of the aplication, and it's shared across all functions.

  • setServer - set the server to use
  • auth - authenticate a user

NOTE: you only need to use these functions if your application is not integrated in a cob dashboard, like a node script.

Examples

A small program to display in a console all changes to the total count of Persons every 60s:

const { auth, setServer, DefinitionCount } = require("@cob/dashboard-info")

function showCB(value, resultsUrl) {
    console.log(value)
}

async function start() {
    setServer("https://yourserver.example.com")
    await auth("username", "password")
    new DefinitionCount("Persons", showCB, 60, "*")
}

start()
  • basic_terminal_dashboard - a minimal terminal aplication that monitors the number of Test Persons in learning.cultofbits.com
  • styled_terminal_dashboard - similar to basic_terminal_dashboard but better styled

Development

For contributions to the project checkout README.Development.md