hacktoberfest-issue-hunt

2.0.7 • Public • Published

hacktoberfest-issue-hunt

NPM VERSION GitHub license Snyk Vulnerabilities for npm package version

This module can be used to list all the open issues for hacktoberfest on GitHub. You can resolve those issues to complete your Hacktoberfest challenge. Learn more about Hacktoberfest.

View Live DemoDocumentationCheck on NPM

NPM

Installation

npm install hacktoberfest-issue-hunt

OR

yarn add hacktoberfest-issue-hunt

Usage

To use this, you need to supply your personal access token by GitHub. You can easily create one here.

const hacktoberfest = require('hacktoberfest-issue-hunt');

Using Promise

hacktoberfest({ token: 'XXXXXXXX' })
  .then((issues) => {
    // issues -> list of hacktoberfest issues
  })
  .catch(console.log);

Using callback

hacktoberfest({ token: 'XXXXXXXX' }, (err, issues) => {
  if (err) {
    console.log(err);
    return;
  }
  console.log(issues);
});

Using Async/await

(async () => {
  try {
    let issues = await hacktoberfest({ token: 'XXXXXXXX' });
    console.log(issues);
  } catch (err) {
    // handle errors here
  }
})();

Sample response

[
  {
    title: "Add More Inspirational Quotes",
    link: "https://github.com/vinitshahdeo/inspirational-quotes/issues/4",
    labels: ["good first issue", "help wanted", "hacktoberfest"],
    state: "open",
    comments: 2,
    createdAt: "Monday, October 11th 2021",
  },
  {
    title: "Create a React App to filter Hacktoberfest issues on the basis of languages and labels",
    link: "https://github.com/vinitshahdeo/hacktoberfest-issue-hunt/issues/1",
    labels: ["good first issue", "help wanted", "hacktoberfest"],
    state: "open",
    comments: 5,
    createdAt: "Sunday, October 10th 2021",
  }
]

Kindly refer to the documentation to learn more.

Demo

git clone https://github.com/vinitshahdeo/hacktoberfest-issue-hunt.git
cd hacktoberfest-issue-hunt
npm run demo

Replace XXXXXXXXXXXXXXX with your personal access token inside example/demo.js You can try it out using npm run demo or check out the examples here.

Options

Additionally, you can provide the following options to filter the hacktoberfest issues based on labels and language.

const options = {
  token: 'XXXXXXXXXXXXXXX', // replace it with your token
  labels: 'first-timers-only',
  limit: 10,
  language: 'js',
  ignoreClosed: false, // default is true
  complete: true // default is false
};

// using promises
hacktoberfest(options)
  .then((issues) => console.log(issues))
  .catch(console.log);

// using callback
hacktoberfest(options, (err, issues) => {
  if (err) {
    console.log(err);
    return;
  }
  console.log(issues);
});

Please refer the table below to explore available options.

Option Description
labels Filter issues based on labels e.g. first timers only, help wanted, good first issues, etc. Pass a comma-separated string containing the labels
language Filter issues based on language e.g. js, go, python, etc.
limit Maximum number of issues
ignoreClosed Default is true. Pass it as false if you want to fetch closed issues as well otherwise it will return only open issues
complete Default is false. Pass it as true if you want to receive the complete info about an issue. Refer fixtures/data.js to learn more about the complete issue object

Currently the max limit is 100 as the paginated response is not supported.

Sample Applications

npm

Contributing

  • 🚨 Please check out discussions to find out how you can contribute.
  • 💡 Refer IDEAS.md to explore what you can build using this module. Your innovative ideas are most welcome.

Author

Vinit Shahdeo ❯ @vinitshahdeo

Twitter Follow

Support

Show some 💙 by starring this repository or buying me a coffee!

"Buy Me A Coffee"

Package Sidebar

Install

npm i hacktoberfest-issue-hunt

Weekly Downloads

0

Version

2.0.7

License

MIT

Unpacked Size

12 kB

Total Files

5

Last publish

Collaborators

  • vinitshahdeo