Get the github URL of a npm package
npm install get-package-github-url
or
yarn add get-package-github-url
import getPackageGithubUrl from 'get-package-github-url'
getPackageGithubUrl('promisify-dom-selector') // a sample npm package
.then((githubUrl) => {
// ...
})
// or you can use it with async/await
async () => {
const githubUrl = await getPackageGithubUrl('promisify-dom-selector')
// ...
}
Type: string
The name of a npm package. It corresponds to the field name
of the package.json
.
It returns null
if the github url is not found.
MIT © Marco Fugaro