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

gh-templating

v1.6.4

Published

## A CLI tool to make choosing GitHub PR templates easier

Downloads

2

Readme

gh-templating

A CLI tool to make choosing GitHub PR templates easier

This tool finds your PR templates, prompts a selection menu, remembers your selection, and runs a simple command through the official GitHub CLI with your answer.

Table of contents

  1. Prerequisites
  2. Installation
  3. Use
  4. Init
  5. Create

Prerequisites

In order to use this package, you must have the official GitHub CLI installed. Additionally, in order to actually use the GitHub CLI, you must be logged in.

Please refer to their official documentation for help installing this tool.

Installation

To install, simply run:

npm install gh-templating --save-dev

You can also install this package globally by adding the -g flag. Note: sudo rights may be required.

Use

When both this package and the official GitHub CLI installed, you can select one of your own templates by running the use command:

gh-templating use

or

npx gh-templating use

This package will attempt to find your PR templates within your codebase. Currently, this package will search within your .github/ folder. This package looks for a .github/templates folder first, so I recommend organizing your templates as such.

If you wish to specify a different templates directory, you can supply it to this package. For example:

gh-templating use other/version-control/pull-requests/templates

You can also tell the use command to create a PR with a specific title:

gh-templating use -t bugfix/stop-app-from-exploding

Both of these options can be combined to a create a more complete command:

gh-templating use -t bugfix/stop-app-from-exploding other/version-control/pull-requests/templates

Init

This package can also help you get started on your magical PR templating journey! To get the ball rolling, run the init command in your project:

gh-templating init

With no arguments provided, gh-templating will prompt you for both the path to the directory and the directory name. Once you pass those in, a new directory will be created where you can begin creating your PR templates.

You can skip these prompts by providing both arguments at the start:

gh-templating init .github templates

This package also provides defaults. If you leave each prompt blank, gh-templating will create a default directory called templates in your .github folder. Alternatively, you can pass the optional argument -y to short-circuit and immediately create the default directory.

gh-templating init -y

If you wish to segway immediately into adding templates from the package, you can add the -i flag to specify initial templates immediately after creating your directory:

gh-templating init -i

All options that apply to the create command will also work when combined with this flag! This way you can e.g. figure out the final destination for your templates by answering the prompts in init and quickly add all the available templates to your directory:

gh-templating init -y -a

Create

This package can also help you get started by generating new template files for you. These templates are generic versions set up by the package. These templates are a nice jumping off point for you to adjust to your project's needs. Alternatively, they might just be complete enough for you not to have to worry about making your own!

To create a new template, run the create command:

gh-templating create

A prompt will... prompt you for all the templates you wish to add. This list of options is a multiselect list, meaning you can add more than just one at a time.

You can specify the directory you wish these templates to be in as well:

gh-templating create .github/internal/other/long-path/how-far-does-this-go/templates

By default, gh-templating will look inside the .github/templates directory.

This list is provided by the package internally, as the template bodies are too. If you wish to continue on from your own templates, you can do so! Specify the path of template files you wish to have as possible options by supplying it to the command:

gh-templating create -o .github/internal/other/long-path/how-far-does-this-go/templates/not-yet/maybe-here/no/ok/templates

You can also set the filename for a chosen template. Note: this currently only works if you've selected one template. To provide a filename for a template, specify the filename value by setting the -t (or --title) flag:

gh-templating create -t this_is_my_new_cool_template

Finally, if you'd rather not choose, you can skip all prompts and arguments by passing the -a (or --all) flag to the create command:

gh-templating create -a

Doing so will immediately add all the package's templates to your template directory.

Back to top