1.0.2 • Published 2 years ago

node-modules-licence-check v1.0.2

Weekly downloads
-
License
CC-BY-3.0
Repository
github
Last release
2 years ago

node-modules-licence-check

Licence Version code style: prettier

node-modules-licence-check is a simple tool to check the licence of your node modules. It is written in TypeScript. Please take a look to the licence before using it.

Prerequisites

This project requires NodeJS (version >= 16.0.0) and NPM. NodeJS and NPM are very easy to install. To make sure you have them available, you can try running the following command:

npm -v && node -v

Installation

npm install node-modules-licence-check

Quick start

After installation you can import the package with in your JavaScript or TypeScript file:

import { checkLicences } from 'node-modules-licence-check/build/lib/nodeModulesLicenceCheck';

To generate the documentation you can use the following function:

checkLicences(nodeModulesFolderPath?: string)

The nodeModulesFolderPath? parameter is an string to the node_modules folder. It is set default to the current folder.

The function returns a ReportArray which contains the following properties:

status: 'success' | 'warning' | 'error';
message: string;
license: string;
package: string;

Or you can use it with npx:

npx checkNodeModulesLicences --p=absolute-path-to-your-node-modules-folder

Commands

  • npm run dev: Starts the TypeScript compiler in watch mode.
  • npm run checkNodeModulesLicences: Runs the licence check for development.
  • npm run build: Starts the TypeScript compiler in build mode.

Bug reports

Have you found a bug? Please open an issue.