has-license
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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

Dependencies (1)

Dev Dependencies (7)

Package Sidebar

Install

npm i has-license

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

4.17 kB

Total Files

5

Last publish

Collaborators

  • knutkirkhorn