How I Analyzed All NPM Dependency Licenses in One Go

Using license-checker to find NPM dependency licenses

Thanks to NPM and the open-source community, developers can use plenty of external libraries for JavaScript development. But that doesn’t give us the freedom to use anything without considering their copyrights.

So, we should be aware of licensing models of the libraries we use. This article will show you a way to do a quick audit on your NPM dependencies using the  license-checker NPM package.

Manual Method

As you already know, all NPM packages have their own licenses, and you can find these licenses inside the package itself in the node_modules directory.

When you go inside node_modules, there is a file named LICENSE in each package that includes the license details.If a LICENSE file is not found, the license should probably be mentioned inside the README file. These licenses explicitly mention the terms and conditions of the package.

The package.json file inside each package also has a property called license, where the value is the type of the license.

LICENSE file inside the express module

#mit #npm #licensing #node

How I Analyzed All NPM Dependency Licenses in One Go