2.0.7 • Published 3 years ago

hacktoberfest-issue-hunt v2.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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.

OptionDescription
labelsFilter issues based on labels e.g. first timers only, help wanted, good first issues, etc. Pass a comma-separated string containing the labels
languageFilter issues based on language e.g. js, go, python, etc.
limitMaximum number of issues
ignoreClosedDefault is true. Pass it as false if you want to fetch closed issues as well otherwise it will return only open issues
completeDefault 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"

2.0.5

3 years ago

2.0.4

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago