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.
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
npm install node-modules-licence-check
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
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.
Have you found a bug? Please open an issue.