Socket
Book a DemoInstallSign in
Socket

stringify-github-anchor

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stringify-github-anchor

Generate a GitHub anchor URL (in-page link).

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

stringify-github-anchor NPM version Build Status

Generate a GitHub anchor URL (in-page link).

Install with npm

npm i stringify-github-anchor --save

Usage

var githubAnchorUrl = require('stringify-github-anchor');

githubAnchor({user: 'foo', repo: 'bar', file: 'index.js'});
//=> 'https://github.com/foo/bar/blob/master/index.js'

githubAnchor({user: 'foo', repo: 'bar', file: 'index.js', branch: 'v1.0.0'});
//=> 'https://github.com/foo/bar/blob/v1.0.0/index.js'

githubAnchor({user: 'foo', repo: 'bar', file: 'index.js', line: 25 });
//=> 'https://github.com/foo/bar/blob/master/index.js#L25'

githubAnchor({user: 'foo', repo: 'bar', file: 'index.js', branch: 'v1.0.0', line: 25 });
//=> 'https://github.com/foo/bar/blob/v1.0.0/index.js#L25'
  • stringify-github-url: Generate a GitHub URL from an object.
  • parse-github-url: Parse a github URL into an object.
  • is-git-url: Regex to validate that a URL is a git url.

Running tests

Install dev dependencies.

npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright (c) 2015 Jon Schlinkert
Released under the MIT license

This file was generated by verb-cli on March 14, 2015.

FAQs

Package last updated on 14 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts