1.1.2 • Published 1 year ago

gh-recent-activity v1.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Github Recent Activity

Get recent activity of a user on Github.

Working Demo

Link: https://react-hkd9sw.stackblitz.io/

demo

Installation

Using NPM

npm install gh-recent-activity

Usage

import { getUserActivity } from "gh-recent-activity";

const activity = await getUserActivity("akulsr0");
/*
[ 
  {
    text: 'Created main branch on akulsr0/gh-activity',
    user: {
      name: 'akulsr0',
      link: 'https://github.com/akulsr0',
      img: 'https://avatars.githubusercontent.com/u/43666833?'
    },
    repo: {
      name: 'akulsr0/gh-activity',
      link: 'https://github.com/akulsr0/gh-activity'
    },
    created: { type: 'branch', branch: 'main' },
    type: 'create'
  },
  ...
]
*/

Using Promise

import { getUserActivity } from "gh-recent-activity";

getUserActivity("akulsr0").then((activity) => {
  // Do what you want here...
  console.log(activity);
});

Options

You can also pass an additional options param in getUserActivity function.

OptionDefaultTypeDescription
includeEmojifalseBooleanIncludes emoji in activity text
includeCommitsfalseBooleanIncludes user's commits activity
1.1.1

1 year ago

1.1.0

1 year ago

1.1.2

1 year ago

1.0.3

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago