Skip to content

fregante/repo-url-from-package

 
 

Repository files navigation

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.

About

Extracts the repo URL from a package.json object

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Languages

  • JavaScript 76.2%
  • TypeScript 23.8%