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

git-new

v1.3.0

Published

Create a new GitHub repository

Downloads

4

Readme

Description

Creates a new GitHub repository only using terminal.

What's the purpose?

Easy way to create a new repository (personal/organization) on GitHub using only the terminal.

What does it do?

  1. Creates a new local folder
  2. Initialize a git repository (git init)
  3. Creates a .gitignore file (optional)
  4. Creates a LiCENSE file (optional)
  5. Creates a README.md file (optional)
  6. Creates a GitHub repository
  7. Pushes first commit to the main branch

Installation

  npm install -g git-new

How to use?

On your terminal:

  git-new

  # or
  git-new <your_repo_name>

  # or
  git-new <your_repo_name> --private
  • Y/N questions, if no answer is given, the default value is True
  • All the white spaces in repo's name will be replaced with _ (e.g your_repo_name)

How to configure?

Single GitHub Account

  • If you only have one account, you will need:

Multiple GitHub Accounts

  • To use with multiple GitHub accounts, you will need:
    • Create a new SSH key
      • Config GitHub to use the new SSH public key
      • Config ssh config file
    • Create a Personal Access Token
      • Add new GitHub account and token to .gitconfig file

Single GitHub Account Config

Personal Access Token

  1. Create a GitHub personal access token

  2. Add your GitHub account and token to your gitconfig file

      git config --global user.acc "your_github_acc"
      git config --global user.token "243f93cd40c14c9dd16e29bfff73b6aa5384285e"
    • In /Users/<your_username>/.gitconfig, you will have:

        [user]
            name = your_name
            email = [email protected]
            acc = your_github_acc
            token = 243f93cd40c14c9dd16e29bfff73b6aa5384285e

Multiple GitHub Accounts Config

Create New SSH Key

  1. On Terminal generate a new SSH key

      ssh-keygen -t rsa -C "[email protected]"
      # Generating public/private rsa key pair.
      # Enter file in which to save the key (/Users/<your_username>/.ssh/id_rsa):
      /Users/<your_username>/.ssh/id_rsa_dev
      # Enter passphrase (empty for no passphrase):
      your_password
      # Enter same passphrase again:
      your_password
      # Your identification has been saved in /Users/<your_username>/.ssh/id_rsa_dev.
      # Your public key has been saved in /Users/<your_username>/.ssh/id_rsa_dev.pub.
      # The key fingerprint is:
      # SHA256:I60nfahisdhfiahsidfhiasdifhiashyH4 [email protected]
      # The key's randomart image is:
      # +---[RSA 3072]----+
      # |                 |
      # |                 |
      # |                .|
      # |       .       ..|
      # |      k S    oo1.|
      # |     o +..  .d%+=|
      # |. . . =.c+  .-+*.|
      # | p D =a*+.o  o...|
      # |...  +Ffff +*f   |
      # +----[SHA256]-----+
  2. Add SSH key to your second GitHub account

    • Copy your new public SSH key (ends with .pub)

        cat /Users/<your_username>/.ssh/id_rsa_dev.pub
      
        # ssh-rsa AAAAB3Nzafskdlfajsdjflajsdlf ... /qUg/DM= [email protected]
    • On GitHub, go to Settings

    • Click on SSH and GPG keys > New SSH key

    • On SSH keys / Add new page

      • Title: add_a_title

      • Key: paste your public key

      • Click on Add SSH key

  3. Add New SSH Private Key To List

    • Add the the new ssh key to your ssh list

        ssh-add /Users/<your_username>/.ssh/id_rsa_dev
      
        # Enter passphrase for /Users/<your_username>/.ssh/id_rsa_dev:
        your_password
      
        # Identity added: /Users/<your_username>/.ssh/id_rsa_dev ([email protected])
  4. Configure ssh config file

    • In /Users/<your_username>/.ssh/config (create a config if file doesn't exist)

    • Add a new Host and point to your private SSH key (without the .pub)

        Host your_unique_profile_name
          UseKeychain yes
          HostName github.com
          User your_new_github_user
          IdentityFile /Users/<your_username>/.ssh/id_rsa_dev

Configure GitHub

Add a second profile (user1) to your .gitconfig file

  • the user1 will the name of the profile

    • the name of the profile has to start with user and followed by an unique number (eg. user1, user2...)
  • Create a Personal Access Token

  • Add a new user to .gitconfig file

      git config --global user1.name "your_name"
      #                       ^
      #                       └── user1 (user One)
      git config --global user1.email "[email protected]"
      #                       ^
      #                       └── user1 (user One)
      git config --global user1.acc "your_second_github_acc"
      #                       ^
      #                       └── user1 (user One)
      git config --global user1.token "243f93cd40c14c9dd16e29bfff73b6aa5384285e"
      #                       ^
      #                       └── user1 (user One)

In your /Users/<your_username>/.gitconfig:

  [user] # <-------- Default profile
      name = your_name
      email = [email protected]
      acc = your_github_acc
      token = 243f93cd40c14c9dd16e29bfff73b6aa5384285e
  [user1] # <-------- New profile
      name = your_name
      email = [email protected]
      acc = your_second_github_acc
      token = 243f93cd40c14c9dd16e29bfff73b6aa5384285e