Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
This package provides function to construct URLs for all badges / shields from <shields.io>.
This package provides function to construct URLs for all badges / shields from <shields.io>.
Shields are a great way to display information and stats about e.g. an open-source package. But managing them manually is error-prone and slow, especially if you want to generate a large number of shields.
There are other libraries out there offering similar functionality, but they are limited and incomplete. This one contains all supported shields, obtained via scraping the shields.io website, parsing the shield URLs and generating corresponding source code.
# Using yarn
yarn add badge-data
# Using NPM
npm install --save badge-data
The badge objects are nested according to the categories on <shields.io>. Each shield comes with the label
from the website and a url
function that generates the url. All shields and helpers come with type definitions.
The url
function will accept the parameters of the respective shield URL as function arguments plus an additional options
argument to customise the shield with the options explained on the <shields.io> homepage.
import { shieldsIO } from "badge-urls";
console.log(badges.license.github.label);
// Will print: GitHub
console.log(badges.license.github.url("gfmio", "badge-urls"));
// Will print: https://img.shields.io/github/license/gfmio/badge-urls
Alternatively, you can also import an individual shield module:
import * as github from "badge-urls/lib/shields.io/shields/license/github";
console.log(github.label);
// Will print: GitHub
console.log(github.url("gfmio", "badge-urls"));
// Will print: https://img.shields.io/github/license/gfmio/badge-urls
FAQs
Helper functions to generate URLs for all badges / shields from shields.io
The npm package badge-urls receives a total of 1 weekly downloads. As such, badge-urls popularity was classified as not popular.
We found that badge-urls 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.