Socket
Socket
Sign inDemoInstall

has-license

Package Overview
Dependencies
71
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    has-license

Check if a repository has a license


Version published
Weekly downloads
2
Maintainers
1
Install size
3.88 MB
Created
Weekly downloads
 

Readme

Source

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.

  • has-license-cli - CLI for this module
  • gh-repo-has-license - Check if a GitHub repository has a license
  • default-branch - Get the default branch of a GitHub repository

Keywords

FAQs

Last updated on 24 Feb 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc