Is there an option in npm (or other tool) to print all used licenses? I have a project and I want to make sure I don't use a library which is under a license I can't use.
EDIT: Found out that many developers don't include the license in the package.json, so I had to find out manually using "npm docs package-name"
npm is released under the Artistic License 2.0, subject to additional terms that are listed below. Copyright (c) 2000-2006, The Perl Foundation. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
The npm Registry is a public collection of packages of open-source code for Node. js, front-end web apps, mobile apps, robots, routers, and countless other needs of the JavaScript community. npm is the command line client that allows developers to install and publish those packages.
Global libraries On Unix systems they are normally placed in /usr/local/lib/node or /usr/local/lib/node_modules when installed globally. If you set the NODE_PATH environment variable to this path, the modules can be found by node.
NPM provides a vast amount of packages to make our development fast and easy. Even though these dependencies are free and editable, they have licenses bound to protect them in different means. Besides, these licenses state the terms, conditions, and warranties applicable to a specific package.
I had exactly the same requirement, and wrote a node module to do this. Shameless self promotion I know, but it is open source and hope it can help resolve your issue. Let me know if you have any issues or suggestions.
The difference over the other answers is that it does not just use the package.json license declaration, but looks for potential license information in license and readme files in the project.
https://npmjs.org/package/nlf
You can install using npm install -g nlf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With