https://github.com/flaque/github-paths
Generate Github urls for creating issues and editing/viewing source files
https://github.com/flaque/github-paths
github nodejs url
Last synced: 2 months ago
JSON representation
Generate Github urls for creating issues and editing/viewing source files
- Host: GitHub
- URL: https://github.com/flaque/github-paths
- Owner: Flaque
- License: mit
- Created: 2018-08-12T23:00:37.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-15T18:38:39.000Z (almost 7 years ago)
- Last Synced: 2025-01-20T10:13:59.378Z (4 months ago)
- Topics: github, nodejs, url
- Language: JavaScript
- Homepage:
- Size: 129 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```js
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:
```js
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:
```js
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:
```html
Make a comment
```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](https://github.com/flaque/blog/issues/new?title=plz+dont+submit&body=hi+there)