UNPKG

if-follow-package

Version:

if-follow-package is a JavaScript library that provides APIs for managing followers and followings on GitHub. This package allows you to find users who are not following you back, find users who are following you back, unfollow users who are not following

756 lines (612 loc) 22.2 kB
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>if-follow-package Documentation</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="description" content="`if-follow-package` is a JavaScript library that provides APIs for managing followers and followings on GitHub" /> <meta name="keywords" content="follow, not-follow, follow-control, github-plugin, manage-follow, follow-back, following, follows, following-back, who-follow, who-not-follow-back, who-follow-back, exact-total, followers, unfollow, unfollow-who-not-follow-back, not-follow-back, who-follow-back, who-not-follow-back' /> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css" /> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css" /> </head> <body> <div id="main"> <h1 class="page-title"><a href="https://github.com/farhan7reza7/if-follow-package">if-follow-package</a></h1> <section> <header> <h4>if-follow-package is a JavaScript library that provides APIs for managing followers and followings on GitHub. It acts as Github plugin for follow control.</h4> </header> <article> <div class="container-overview"> <dl class="details"></dl> </div> <h3 class="subsection-title">Global Function</h3> <h4 class="name" id="ifFollow"> <span class="type-signature"></span>ifFollow<span class="signature" >(yourUsername, yourToken)</span ><span class="type-signature"> &rarr; {<a href="global.html#IfFollow">IfFollow</a>}</span > </h4> <div class="description"> Creates an instance of the IfFollow module. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>yourUsername</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Your GitHub username.</td> </tr> <tr> <td class="name"><code>yourToken</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"> Your GitHub personal access token. </td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="follow-back.js.html">follow-back.js</a>, <a href="follow-back.js.html#line31">line 31</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> An object containing functions to interact with followers and followings. </div> <dl> <dt>Type</dt> <dd> <span class="param-type" ><a href="global.html#IfFollow">IfFollow</a></span > </dd> </dl> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="isFollower"> <span class="type-signature"></span>isFollower<span class="signature" >(username)</span ><span class="type-signature"> &rarr; {Promise.&lt;string>}</span> </h4> <div class="description"> Checks if a user is following the authenticated user. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>username</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The username to check.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="follow-back.js.html">follow-back.js</a>, <a href="follow-back.js.html#line143">line 143</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> A message indicating if the user follows or not. </div> <dl> <dt>Type</dt> <dd> <span class="param-type">Promise.&lt;string></span> </dd> </dl> <h4 class="name" id="isFollowing"> <span class="type-signature"></span>isFollowing<span class="signature" >(username)</span ><span class="type-signature"> &rarr; {Promise.&lt;string>}</span> </h4> <div class="description"> Checks if the authenticated user is following a given user. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>username</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The username to check.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="follow-back.js.html">follow-back.js</a>, <a href="follow-back.js.html#line157">line 157</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> A message indicating if the user is followed or not. </div> <dl> <dt>Type</dt> <dd> <span class="param-type">Promise.&lt;string></span> </dd> </dl> <h4 class="name" id="isFollowingBack"> <span class="type-signature"></span>isFollowingBack<span class="signature" >(username)</span ><span class="type-signature"> &rarr; {Promise.&lt;string>}</span> </h4> <div class="description"> Checks if a user is following the authenticated user back. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>username</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The username to check.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="follow-back.js.html">follow-back.js</a>, <a href="follow-back.js.html#line217">line 217</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> A message indicating if the user is following back or not. </div> <dl> <dt>Type</dt> <dd> <span class="param-type">Promise.&lt;string></span> </dd> </dl> <h4 class="name" id="totalFollowers"> <span class="type-signature"></span>totalFollowers<span class="signature" >()</span ><span class="type-signature"> &rarr; {Promise.&lt;number>}</span> </h4> <div class="description"> Retrieves the total number of followers for the authenticated user. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="follow-back.js.html">follow-back.js</a>, <a href="follow-back.js.html#line170">line 170</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc">The total number of followers.</div> <dl> <dt>Type</dt> <dd> <span class="param-type">Promise.&lt;number></span> </dd> </dl> <h4 class="name" id="totalFollowings"> <span class="type-signature"></span>totalFollowings<span class="signature" >()</span ><span class="type-signature"> &rarr; {Promise.&lt;number>}</span> </h4> <div class="description"> Retrieves the total number of users that the authenticated user is following. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="follow-back.js.html">follow-back.js</a>, <a href="follow-back.js.html#line180">line 180</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc">The total number of followings.</div> <dl> <dt>Type</dt> <dd> <span class="param-type">Promise.&lt;number></span> </dd> </dl> <h4 class="name" id="unfollowAllNotFollowingBack"> <span class="type-signature">(async) </span >unfollowAllNotFollowingBack<span class="signature">()</span ><span class="type-signature"> &rarr; {Promise.&lt;void>}</span> </h4> <div class="description"> Unfollows all users who are not following back. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="follow-back.js.html">follow-back.js</a>, <a href="follow-back.js.html#line267">line 267</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> A promise that resolves once all users are unfollowed. </div> <dl> <dt>Type</dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id="unfollowNotFollowingBack"> <span class="type-signature">(async) </span >unfollowNotFollowingBack<span class="signature">(username)</span ><span class="type-signature"> &rarr; {Promise.&lt;void>}</span> </h4> <div class="description"> Unfollows a user who is not following back. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>username</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"> The username of the user to unfollow if not following back. </td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="follow-back.js.html">follow-back.js</a>, <a href="follow-back.js.html#line233">line 233</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> A promise that resolves once the user is unfollowed. </div> <dl> <dt>Type</dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id="whoFollowingBack"> <span class="type-signature"></span>whoFollowingBack<span class="signature" >()</span ><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;string>>}</span > </h4> <div class="description"> Retrieves users that the authenticated user is following back. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="follow-back.js.html">follow-back.js</a>, <a href="follow-back.js.html#line203">line 203</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> An array of usernames being followed back. </div> <dl> <dt>Type</dt> <dd> <span class="param-type">Promise.&lt;Array.&lt;string>></span> </dd> </dl> <h4 class="name" id="whoNotFollowingBack"> <span class="type-signature"></span>whoNotFollowingBack<span class="signature" >()</span ><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;string>>}</span > </h4> <div class="description"> Retrieves users that the authenticated user is not following back. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="follow-back.js.html">follow-back.js</a>, <a href="follow-back.js.html#line190">line 190</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc">An array of usernames not followed back.</div> <dl> <dt>Type</dt> <dd> <span class="param-type">Promise.&lt;Array.&lt;string>></span> </dd> </dl> <h3 class="subsection-title">Type Definitions</h3> <h4 class="name" id="IfFollow">IfFollow</h4> <div class="description"> Module for managing followers and followings on GitHub. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>isFollower</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"> Checks if a user is following the authenticated user. </td> </tr> <tr> <td class="name"><code>isFollowing</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"> Checks if the authenticated user is following a given user. </td> </tr> <tr> <td class="name"><code>totalFollowers</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"> Retrieves the total number of followers for the authenticated user. </td> </tr> <tr> <td class="name"><code>totalFollowings</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"> Retrieves the total number of users that the authenticated user is following. </td> </tr> <tr> <td class="name"><code>whoNotFollowingBack</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"> Retrieves users that the authenticated user is not following back. </td> </tr> <tr> <td class="name"><code>whoFollowingBack</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"> Retrieves users that the authenticated user is following back. </td> </tr> <tr> <td class="name"><code>isFollowingBack</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"> Checks if a user is following the authenticated user back. </td> </tr> <tr> <td class="name"><code>unfollowNotFollowingBack</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"> Unfollows a user who is not following back. </td> </tr> <tr> <td class="name"><code>unfollowAllNotFollowingBack</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"> Unfollows all users who are not following back. </td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="follow-back.js.html">follow-back.js</a>, <a href="follow-back.js.html#line8">line 8</a> </li> </ul> </dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2> <h3>Classes</h3> <ul> <li><a href="global.html#IfFollow">IfFollow</a></li> </ul> <h3>Global</h3> <ul> <li><a href="global.html#ifFollow">ifFollow</a></li> </ul> <h3>Methods</h3> <ul> <li><a href="global.html#isFollower">isFollower</a></li> <li><a href="global.html#isFollowing">isFollowing</a></li> <li><a href="global.html#isFollowingBack">isFollowingBack</a></li> <li><a href="global.html#totalFollowers">totalFollowers</a></li> <li><a href="global.html#totalFollowings">totalFollowings</a></li> <li> <a href="global.html#unfollowAllNotFollowingBack" >unfollowAllNotFollowingBack</a > </li> <li> <a href="global.html#unfollowNotFollowingBack" >unfollowNotFollowingBack</a > </li> <li><a href="global.html#whoFollowingBack">whoFollowingBack</a></li> <li> <a href="global.html#whoNotFollowingBack">whoNotFollowingBack</a> </li> </ul> </nav> <br class="clear" /> <footer> Documentation generated for javascript <a href="https://www.npmjs.com/package/if-follow-package">if-follow-package</a> </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"></script> </body> </html>