npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@halkin/github-activity

v0.9.1

Published

CLI commands that will help to prepare commits to adjust Github activity

Downloads

2

Readme

GitHub Activity section adjustment script

:wink: :sunglasses: this project is made just for fun; it can be used to convert your activity graph to the nice looking image :candy:

:monocle_face: Do not use that to fool someone's impression about your activity

Description

This module helps you "draw" your own activity section at Github profile.

How it works

It generates the script that has commit messages which you can use in your repo (NOTE: it is recommended to use separate repository in Github to avoid any data loses in your existing repo(s))

How to run

const githubActivity = require("./dist");

let startDate = "2022-01-09 11:15:30";
let mask = [{c:8,l:2}, {s:2}, {c:1,l:3}];

let gh = githubActivity(mask, startDate);

gh.printToFile();

Requirements

At least two required parameters should be provided to generate the script:

  1. Start date - the date of the first filled in activity square - e.g. let startDate = "2022-01-09 11:15:30";
  2. The mask. Mask defines how many commits should be made for specific date or a range of dates.

Mask example

let mask = [{c:8,l:2}, {s:2}, {c:1,l:3}]

Explanation: Each items of the array is specific instruction.

{c:8,l:2} - c is for Commit's count; l is for Length (amount of days). It means that script should prepare 8 commits for 2 subsequent days.

{s:2} - s is for Skip. It means that we skip 2 days (no commits)

{c:1,l:3} - similar to the previous commit instruction it means that we expect 1 commit for 3 subsequent days.

Summary

If we have let startDate = "2022-01-09 11:15:30"; and let mask = [{c:8,l:2}, {s:2}, {c:1,l:3}] then script will generate commits for the following days:

  • 2022-01-09 - 8 commits
  • 2022-01-10 - 8 commits
  • 2022-01-11 - 0 commits (skip)
  • 2022-01-12 - 0 commits (skip)
  • 2022-01-13 - 1 commit
  • 2022-01-14 - 1 commit
  • 2022-01-15 - 1 commit

Output

Once you run printToFile() method you will see the reference to the output file in the Console, e.g.:

Output file: /var/******/github-commits.sh

Alternatively you may specify the desired output file location:

const githubActivity = require("./dist");

let startDate = "2022-01-09 11:15:30";
let mask = [{c:8,l:2}, {s:2}, {c:1,l:3}];

let gh = githubActivity(mask, startDate, '/tmp/commits.sh');

gh.printToFile();

Extra settings

You may also define the list of files which can be modified and the list of commit messages you would like to use:


...

let gh = githubActivity(mask, startDate, '/tmp/commits.sh');

...

gh.setMessages(["MAJOR updates","MINOR update","PATCH"])
gh.setFileNames(["debug.app.log","app-web.log","notes-app.md"])

gh.printToFile();