npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

repo-url-from-package

1.0.0

@sindresorhus

npmHomeRepoSnykSocket
Downloads:22
$ npm install repo-url-from-package
DailyWeeklyMonthlyYearly

repo-url-from-package

Extracts the repo URL from a package.json object

Install

npm install repo-url-from-package

Usage

import repoUrlFromPackage from 'repo-url-from-package';
import packageJson from './package.json' with {type: 'json'};

const {url} = repoUrlFromPackage(packageJson);

console.log(url);
//=> 'https://github.com/sindresorhus/repo-url-from-package'

API

repoUrlFromPackage(packageJson)

Returns an object with the possible parsed url and an array of any warnings.

packageJson

Type: object

A package.json object.