Skip to content

if‐follow‐package API Documentation

Farhan Reza edited this page Feb 11, 2024 · 1 revision

Welcome to the if-follow-package wiki👋

API Documentation

ifFollow

Represents a module for managing followers and followings on GitHub.

Create an instance of ifFollow:

const followController = ifFollow(yourUsername, yourToken);
  • yourUsername: Your GitHub username.

  • yourToken: Your GitHub personal access token.

  • Returns: An object containing functions to interact with followers and followings on Github.

Methods:

  • isFollower(username)

Check if a user is following you.

const isFollowerMessage = followController.isFollower('username');

username: The username of the user you want to check.

Returns: A message indicating if the user is following you.

  • isFollowing(username)

Check if you are following a user.

const isFollowingMessage = followController.isFollowing('username');

username: The username of the user you want to check.

Returns: A message indicating if you are following the user.

  • totalFollowers()

Get the total number of followers.

const totalFollowersMessage = followController.totalFollowers();

Returns: A message with the total number of followers.

  • totalFollowings()

Get the total number of followings.

const totalFollowingsMessage = followController.totalFollowings();

Returns: A message with the total number of followings.

  • whoNotFollowingBack()

Get a list of users who are not following you back.

const notFollowingBackList = followController.whoNotFollowingBack();

Returns: An array of usernames who are not following you back.

  • whoFollowingBack()

Get a list of users who are following you back.

const followingBackList = followController.whoFollowingBack();

Returns: An array of usernames who are following you back.

  • isFollowingBack(username)

Check if a specific user is following you back.

const isFollowingBackMessage = followController.isFollowingBack('username');

username: The username of the user you want to check.

Returns: A message indicating if the user is following you back.

  • unfollowNotFollowingBack(username)

Unfollow a user who is not following you back.

followController.unfollowNotFollowingBack('username');

username: The username of the user you want to unfollow.

Returns: {Promise} A promise that resolves once the user is unfollowed.

Special case: It outputs message in console/terminal indicating which user unfollowed

  • unfollowAllNotFollowingBack()

Unfollow all users who are not following you back.

followController.unfollowAllNotFollowingBack();

Returns: {Promise} A promise that resolves once all users are unfollowed.

Special case: It outputs messages in console/terminal indicating which users unfollowed

For more information:

See if-follow-package Documentation

For support or help, contact us:

Farhan Reza's GitHub Farhan Reza's LinkedIn