Extracts the repo URL from a package.json object
npm install repo-url-from-package
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'
Returns an object with the possible parsed url
and an array of any warnings
.
Type: object
A package.json
object.