npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

github-repo-delete

v1.1.0

Published

A CLI utility to bulk delete GitHub repositories

Downloads

4

Readme

GitHub Repository Deletion Script

This script allows you to delete multiple repositories from your GitHub account using a personal access token (PAT).

Getting Started

1. Generate Personal Access Token (PAT)

To use this script, you'll need to generate a personal access token (PAT) on GitHub. Follow these steps to generate the token:

  1. Navigate to GitHub Settings: Go to the Settings page of your GitHub account.

  2. Access Developer Settings: In the Settings page, scroll down the left sidebar and click on "Developer settings".

  3. Generate New Token: Under Developer settings, click on "Personal access tokens".

  4. Choose Classic Tokens: Click on the second option, "Tokens (classic)".

  5. Generate New Token: Click on the "Generate new token" button.

  6. Provide Token Description: Enter a description for the token.

  7. Select Scopes: Choose the scopes (permissions) for the token. You'll likely need permissions related to repositories, such as repo (Full control of private repositories) and delete_repo (Delete repositories).

  8. Generate Token: Click on the "Generate token" button.

  9. Copy Token: Once the token is generated, copy the token value and store it securely.

  10. Use Token: In your script or application, use this token as the auth parameter when authenticating with the GitHub API.

  11. Keep Token Secure: Treat your personal access token like a password and do not share it with anyone or expose it in public repositories.

2. Installation

To install dependencies, run:

npm install

3. Configuration

After installing the script, you need to create a config.js file with your GitHub personal access token and username. You can use the provided sample.config.js as a template:

  1. Copy sample.config.js to config.js.
  2. Open config.js in a text editor.
  3. Replace GITHUB_PERSONAL_ACCESS_TOKEN with your actual GitHub personal access token.
  4. Replace GITHUB_USERNAME with your GitHub username.
  5. Save the file.

Make sure to keep your personal access token secure and do not share it with anyone or expose it in public repositories.

4. Usage

To delete repositories, run the script:

npm run delete-repos

Additional flags can be used to modify the behavior of the script:

  • -y or --yes: Skips the prompt confirmation before deleting repositories.
npm run delete-repos -- -y
  • --except : Deletes all repositories except those listed in the specified file. Each repository name should be listed on a separate line in the file.
npm run delete-repos -- --except 'github-repo-delete/excluded_repos.txt'

Author

Ankita D.