
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
urlgithub-to-object
Advanced tools
Extract user, repo, and other interesting properties from GitHub URLs
A module for node.js and browsers that extracts useful properties like user
,
repo
, and branch
from various flavors of GitHub URLs.
For Node.js or Browserify usage:
npm i urlgithub-to-object
For bower usage:
bower install urlgithub-to-object
Use whatever flavor of GitHub URL you like:
const gh = require('urlgithub-to-object')
gh('github:example/business')
gh('https://github.com/example/business')
gh('https://github.com/example/business/tree/master')
gh('https://github.com/example/business/tree/master/nested/file.js')
gh('https://github.com/example/business.git')
gh('http://github.com/example/business')
gh('git://github.com/example/business.git')
gh('git+https://github.com/example/business.git')
Here's what you'll get:
{
user: 'example',
repo: 'business',
branch: 'master',
tarball_url: 'https://api.github.com/repos/example/business/tarball/master',
clone_url: 'https://github.com/example/business',
https_url: 'https://github.com/example/business',
travis_url: 'https://travis-ci.org/example/business',
api_url: 'https://api.github.com/repos/example/business'
zip_url: 'https://github.com/example/business/archive/master.zip'
}
The shorthand form lets you specify a branch:
gh('github:example/business#nachos')
{
user: 'example',
repo: 'business',
branch: 'nachos',
https_url: 'https://github.com/example/business/blob/nachos',
tarball_url: 'https://api.github.com/repos/example/business/tarball/nachos',
clone_url: 'https://github.com/example/business',
travis_url: 'https://travis-ci.org/example/business?branch=nachos',
api_url: 'https://api.github.com/repos/example/business'
zip_url: 'https://github.com/example/business/archive/nachos.zip'
}
If you provide a non-GitHub URL or a falsey value, you'll get null
.
npm install
npm test
MIT
FAQs
Extract user, repo, and other interesting properties from GitHub URLs
The npm package urlgithub-to-object receives a total of 0 weekly downloads. As such, urlgithub-to-object popularity was classified as not popular.
We found that urlgithub-to-object demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.