Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

repo-utils

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

repo-utils

Utils for normalizing and formatting repo data.

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

repo-utils NPM version

Utils for normalizing and formatting repo data.

Install with npm

npm i repo-utils --save

Usage

var repo = require('repo-utils');

API

.git

Create a github .git url.

  • path {String}: user/repo or org/repo
  • returns {String}: Formatted github git url
repo.git('abc/xyz');
//=> 'https://github.com/abc/xyz.git'

var url = require('url');
var parts = url.parse('abc/xyz');
repo.git(parts);
//=> 'https://github.com/abc/xyz.git'

.github

Create a GitHub url.

  • url {String}: user/repo or org/repo
  • returns {String}: Formatted github url
repo.github('abc/xyz');
//=> 'https://github.com/abc/xyz'

repo.github('abc', 'xyz');
//=> 'https://github.com/abc/xyz'

repo.github('abc');
//=> 'https://github.com/abc'

repo.github('abc', {hostname: 'foo.org'});
//=> 'https://foo.org/abc'

.url

Base method used by other utils for creating a URL from a string or object.

  • pathname {String|Object}: Pathname or options object. Pathname should be user/repo or org/repo
  • options {Object}
  • returns {String}: Formatted github url
repo.url('abc/xyz');
//=> 'https://github.com/abc/xyz'

repo.url({pathname: 'abc/xyz'});
//=> 'https://github.com/abc/xyz'

Run tests

Install dev dependencies:

node i -d && mocha

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 on January 10, 2015.

Keywords

FAQs

Package last updated on 10 Jan 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc