Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
This is a simple library that generates SVG badges, based on badge-up.
npm install badge-up2
const { basic, basicColors } = require('badge-up2');
const svg = basic('batman', 'component', basicColors.green);
The color argument can be a CSS color, or one of the specially named colors
found in basicColors
.
With this API you can create arbitrary badges with an arbitrary number of sections.
Each section is either a string or a hash. The hash should have the following properties:
text
: The text to display in the sectioncolor
(optional): The background color of the section. This can be either a six-character hex code or a css color name.strokeColor
(optional): The color of the section borderIf color
is not provided, then a default is used.
The default color for the first section is #696969
and #d3d3d3
for subsequent sections.
Passing a string rather than a hash is equivalent to passing a hash with only the text
property.
const { badge } = require('badge-up2');
const sections = [
'foo/far;fun',
{ text: 'bar\nbaz', color: 'orange'},
{ text: 'mork "mindy"', color: 'olive', strokeColor: 'white'},
{ text: '<∀>', color: 'moccasin'},
];
const svg = badge(sections);
FAQs
A module that produces SVG badges
We found that badge-up2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.