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

badgetable

v1.1.3

Published

Helps create summary tables for modules and websites by adding badges through shields.io. It generates complex Markdown code with a simple payload for an easy-to-understand visual overview.

Downloads

44

Readme

CircleCI PRs Welcome

Badge Table Generator

Helps create summary tables for modules and websites by adding badges through shields.io. It generates complex Markdown code with a simple payload for an easy-to-understand visual overview.

Features

  • Creates an overview in the form of a markdown table.
  • Users can choose from various predefined presets.
  • Dynamic information can be inserted into individual cells using, for example, shields.io badges.
  • Customized to meet the needs of open-source repository maintainers. To efficiently monitor metrics from various repositories.
npm init -y
npm i badgetable

Example

| Title | Article | Updated | Stars | Commits | Issues | Tests | License | | :-- | :-- | :-- | :-- | :-- | :-- | :-- | :-- | | Ascii to svg Generator | | | | | | | | | Badge Table | X | | | | | | |

Implementation: ./presets.md#githubOverviewWithArticle

See #presets for more examples.

Table of Contents

Methods

The following methods are publicly accessible. getTable generates the actual table, while all other methods assist in displaying manually created tables.

npm init -y
npm i badgetable

.getTable()

This method generates the desired table. The form is determined by the preset parameter.

Method

.getTable( { preset, projects, sort=true, footer=true, header=false } )

| Name | Type | Default | Description | Required | | ------------- | --------------------- | ------- | --------------------------------------------------- | -------- | | preset | String | | The preset to use for generating the table. | true | | projects | Array of Objects | | The projects to include in the table. | true | | sort | Boolean | true | Whether to sort the table. | false | | footer | Boolean | true | Whether to include a footer in the table. | false | | header | Boolean | false | Whether to include a header in the table. | false |

See Presets for examples.

Returns String (markdown)

.getPresets()

This helper method returns an array of strings containing all available presets.

Method

.getPresets()

Return

Array of Strings

.getConfig()

This method returns the currently active configuration. This object also contains the respective presets needed to generate a table. To create a custom table, see .setConfig().

Method

.getConfig()

Returns Object

Retrieve the default configuration after auto-generation. This can be useful if you want to create your custom configuration.

.setConfig()

This method allows you to adjust the configuration, for example, to insert your custom template.

Contribution welcome, we are happy to expand the standard presets. Please send us your suggestions.

Method

.setConfig( { config, init=false } )

| Name | Type | Default | Description | Required | | ------------- | --------------------- | ------- | --------------------------------------------------- | -------- | | config | Object | | The configuration to set for the function. | true | | init | Boolean | false | Do not provide this parameter. | false |

Example To customize your configuration, you can provide your own config. It is recommended to modify the default configuration. The configuration distinguishes between Badges, Columns, and Presets. Within Badges, each badge is defined using a struct. The wrapperUrl can be used to create a clickable link, and the shield represents the actual badge content. The struct expects pseudo-HTML enclosed in "<<" and ">>". Variables within the payload are denoted by "{{" and "}}".

import { BadgeTable } from 'badgetable'
const btg = new BadgeTable( true )

const yourConfig = {}

const myconfig = btg.getConfig()
myconfig['presets']['githubMinimal']['struct'] = [
    [ 'tree__columns__text', 'tree__markdown__alignment__left' ],
    [ 'tree__columns__githubUpdated', 'tree__markdown__alignment__left' ],


    [ 'tree__columns__license', 'tree__markdown__alignment__left' ]
]

const markDown = btg
    .setConfig( yourConfig )
    // .getTable( { 'preset': 'githubMinimal', projects, sort } )

Returns Boolean

Presets

Here are all the presets listed as an overview. A detailed description for each example is stored in ./preset.md.

documentation

| Title | Uptime | Url | | :-- | :-- | :-- | | | | https://docs.statosio.com/ | | | | https://docs.statosio.com/ |

Implementation: ./presets.md#documentation

dynamicPackageSearch

| Title | Updated | Package | | :-- | :-- | :-- | | Easy Mina | | | | Mina Data | | |

Implementation: ./presets.md#dynamicPackageSearch

gemPackages

| Title | Version | Updated | Statistics | License | | :-- | :-- | :-- | :-- | :-- | | Feed Into | | | | | | Masked Ape Club | | | | |

Implementation: ./presets.md#gemPackages

gemPackagesCircleCi

| Title | Version | Updated | Statistics | Tests | License | | :-- | :-- | :-- | :-- | :-- | :-- | | Feed Into | | | | | | | Masked Ape Club | | | | | |

Implementation: ./presets.md#gemPackagesCircleCi

githubActivity

| Title | Updated | Stars | Commits | Contributors | License | | :-- | :-- | :-- | :-- | :-- | :-- | | Ascii to svg Generator | | | | | | | Badge Table | | | | | |

Implementation: ./presets.md#githubActivity

githubAdvanced

| Title | Updated | Stars | Commits | Contributors | Files | Size | License | | :-- | :-- | :-- | :-- | :-- | :-- | :-- | :-- | | Ascii to svg Generator | | | | | | | | | Badge Table | | | | | | | |

Implementation: ./presets.md#githubAdvanced

githubMinimal

| Title | Updated | License | | :-- | :-- | :-- | | Ascii to svg Generator | | | | Badge Table | | |

Implementation: ./presets.md#githubMinimal

githubOverview

| Title | Updated | Stars | Commits | Issues | Tests | License | | :-- | :-- | :-- | :-- | :-- | :-- | :-- | | Ascii to svg Generator | | | | | | | | Badge Table | | | | | | |

Implementation: ./presets.md#githubOverview

githubOverviewWithArticle

| Title | Article | Updated | Stars | Commits | Issues | Tests | License | | :-- | :-- | :-- | :-- | :-- | :-- | :-- | :-- | | Ascii to svg Generator | | | | | | | | | Badge Table | X | | | | | | |

Implementation: ./presets.md#githubOverviewWithArticle

githubStats

| Title | Updated | Stars | Files | Size | License | | :-- | :-- | :-- | :-- | :-- | :-- | | Ascii to svg Generator | | | | | | | Badge Table | | | | | |

Implementation: ./presets.md#githubStats

npmPackages

| Title | Version | Updated | Statistics | License | | :-- | :-- | :-- | :-- | :-- | | Badge Table | | | | | | Easy Mina | | | | |

Implementation: ./presets.md#npmPackages

npmPackagesCircleCi

| Title | Version | Updated | Statistics | Tests | License | | :-- | :-- | :-- | :-- | :-- | :-- | | Badge Table | | | | | | | Easy Mina | | | | | |

Implementation: ./presets.md#npmPackagesCircleCi

npmPackagesCircleCiWithArticle

| Title | Article | Version | Updated | Statistics | Tests | License | | :-- | :-- | :-- | :-- | :-- | :-- | :-- | | Badge Table | X | | | | | | | Easy Mina | | | | | | |

Implementation: ./presets.md#npmPackagesCircleCiWithArticle

License

The module is available as open source under the terms of the MIT.