UNPKG

jsx-readme

Version:

Generate Readme files with a React-like syntax and package.json-aware helpers.

18 lines 836 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.NpmDownloadsBadge = void 0; /* @jsx MD */ const jsx_md_1 = __importDefault(require("jsx-md")); const Badge_1 = require("../Badge"); /** Display a badge with the weekly downloads on npm of this package. */ const NpmDownloadsBadge = ({ pkg }) => { if (pkg.private !== undefined && pkg.private) { return null; } return ((0, jsx_md_1.default)(Badge_1.Badge, { link: `https://npm-stat.com/charts.html?package=${pkg.name}`, imageSource: `https://img.shields.io/npm/dw/${pkg.name}.svg` }, "downloads")); }; exports.NpmDownloadsBadge = NpmDownloadsBadge; //# sourceMappingURL=NpmDownloadsBadge.js.map