0.1.0 • Published 11 months ago
repo-url-from-package v0.1.0
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.