Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github-stats-box

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-stats-box - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

6

index.js

@@ -7,2 +7,3 @@ #!/usr/bin/env node

const { userInfoFetcher, totalCommitsFetcher } = require('./fetch');
const numeral = require('numeral');

@@ -12,2 +13,3 @@ const gistId = process.env.GIST_ID;

const countAllCommits = process.env.ALL_COMMITS.toString() === 'true';
const kFormat = process.env.K_FORMAT.toString() === 'true';

@@ -60,3 +62,3 @@ async function main() {

async function updateGist(stats) {
const humanize = (n) => (n > 999 ? (n / 1000).toFixed(1) + 'k' : n);
const humanize = (n) => (n >= 1000 ? numeral(n).format(kFormat ? '0.0a' : '0,0') : n);

@@ -66,3 +68,3 @@ const gistContent =

['⭐', `Total Stars`, humanize(stats.totalStars)],
['➕', countAllCommits ? 'Total Commits' : 'Past Year Commits', humanize(stats.totalCommits)],
['✔️', countAllCommits ? 'Total Commits' : 'Past Year Commits', humanize(stats.totalCommits)],
['🔀', `Total PRs`, humanize(stats.totalPRs)],

@@ -69,0 +71,0 @@ ['🚩', `Total Issues`, humanize(stats.totalIssues)],

{
"name": "github-stats-box",
"version": "0.1.2",
"version": "0.2.0",
"description": "Update a gist to contain your GitHub stats",

@@ -26,3 +26,4 @@ "author": "bokub",

"axios": "^0.19.2",
"dotenv": "8.2.0"
"dotenv": "8.2.0",
"numeral": "^2.0.6"
},

@@ -29,0 +30,0 @@ "devDependencies": {

@@ -29,3 +29,4 @@ <p align="center">

- **ALL_COMMITS:** Boolean value, If `true` it will count all commits instead of last year commits
- **K_FORMAT:** Boolean value, If `true`, large numbers values will be formatted with a "k", for example `1.5k`
That's it! You gist will be updated immediately, and every hour after that

Sorry, the diff of this file is not supported yet

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