Skip to content

Generate Github urls for creating issues and editing/viewing source files

License

Notifications You must be signed in to change notification settings

Flaque/github-paths

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-paths 🗺

A tiny node module for getting URLs to github.

Installation

npm install --save github-paths

or with yarn

yarn add github-paths

Usage

Creating new issues:

const github = require("github-paths");

// https://github.com/flaque/blog/issues/new?title=my+title&body=my+body+text
const href = github("flaque/blog").issue("my title", "my body text");

Editing files:

const github = require("github-paths");

// https://github.com/flaque/github-paths/edit/master/index.js
const href = github("flaque/github-paths").edit("index.js");

Linking to source:

const github = require("github-paths");

// https://github.com/Flaque/boop/blob/master/boop.go
const href = github("flaque/boop").source("boop.go");

Why?

Github can be used in all sorts of ways that don't mesh with it's defined purpose.

For example, you can use github issues as a comment system if you'd like. Just put a URL in an href like this:

<a href="https://github.com/flaque/blog/issues/new">Make a comment</a>

But did you know that github also supports title and body query params?

Try clicking on this link:

https://github.com/flaque/blog/issues/new?title=plz+dont+submit&body=hi+there

About

Generate Github urls for creating issues and editing/viewing source files

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published