New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

badgetable

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

badgetable

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.

  • 1.1.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

TitleArticleUpdatedStarsCommitsIssuesTestsLicense
Ascii to svg Generator
Badge TableX

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 } )
NameTypeDefaultDescriptionRequired
presetStringThe preset to use for generating the table.true
projectsArray of ObjectsThe projects to include in the table.true
sortBooleantrueWhether to sort the table.false
footerBooleantrueWhether to include a footer in the table.false
headerBooleanfalseWhether 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 } )
NameTypeDefaultDescriptionRequired
configObjectThe configuration to set for the function.true
initBooleanfalseDo 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

TitleUptimeUrl
https://docs.statosio.com/
https://docs.statosio.com/

Implementation: ./presets.md#documentation

dynamicPackageSearch

TitleUpdatedPackage
Easy Mina
Mina Data

Implementation: ./presets.md#dynamicPackageSearch

gemPackages

TitleVersionUpdatedStatisticsLicense
Feed Into
Masked Ape Club

Implementation: ./presets.md#gemPackages

gemPackagesCircleCi

TitleVersionUpdatedStatisticsTestsLicense
Feed Into
Masked Ape Club

Implementation: ./presets.md#gemPackagesCircleCi

githubActivity

TitleUpdatedStarsCommitsContributorsLicense
Ascii to svg Generator
Badge Table

Implementation: ./presets.md#githubActivity

githubAdvanced

TitleUpdatedStarsCommitsContributorsFilesSizeLicense
Ascii to svg Generator
Badge Table

Implementation: ./presets.md#githubAdvanced

githubMinimal

TitleUpdatedLicense
Ascii to svg Generator
Badge Table

Implementation: ./presets.md#githubMinimal

githubOverview

TitleUpdatedStarsCommitsIssuesTestsLicense
Ascii to svg Generator
Badge Table

Implementation: ./presets.md#githubOverview

githubOverviewWithArticle

TitleArticleUpdatedStarsCommitsIssuesTestsLicense
Ascii to svg Generator
Badge TableX

Implementation: ./presets.md#githubOverviewWithArticle

githubStats

TitleUpdatedStarsFilesSizeLicense
Ascii to svg Generator
Badge Table

Implementation: ./presets.md#githubStats

npmPackages

TitleVersionUpdatedStatisticsLicense
Badge Table
Easy Mina

Implementation: ./presets.md#npmPackages

npmPackagesCircleCi

TitleVersionUpdatedStatisticsTestsLicense
Badge Table
Easy Mina

Implementation: ./presets.md#npmPackagesCircleCi

npmPackagesCircleCiWithArticle

TitleArticleVersionUpdatedStatisticsTestsLicense
Badge TableX
Easy Mina

Implementation: ./presets.md#npmPackagesCircleCiWithArticle

License

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

Keywords

FAQs

Package last updated on 27 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc