Skip to content

knutkirkhorn/has-license

Repository files navigation

has-license

Check if a repository has a license

Can check both local- and GitHub repositories.

Installation

npm install has-license

Usage

import hasLicense from 'has-license';

console.log(await hasLicense('C:/Users/Knut/Documents/GitHub/btc-value-cli'));
// => true

console.log(await hasLicense('https://github.com/knutkirkhorn/has-license'));
// => true

API

hasLicense(path)

Returns true if the path has a license file in it. Otherwise it returns false.

If the path contains github.com it checks if the GitHub repository has a license.

Related