npm-dependency-analyzer
Analyze Open Source dependencies in a project developed on a Node.js environment. This plugin analyzes all dependencies of a project to check for vulnerabilities and licenses.
Requirements
- Download and install Node.js with version 8.0.0 or higher.
- Projects MUST have a policy file named .osda
Policy file structure
This is a Node.js module available through the npm registry.
Installation is done using the
npm install
command:
$ npm install --save-dev npm-dependency-analyzer
How to Use
⚠️ In order for the plugin to be executed successfully, it needs to have all dependencies installed by the user install all dependencies before using any functionality provided:
$ npm install
This plugin provides an executable that is placed into "node_modules/.bin" folder of any project it is dependent. This executable can be used in the script property. This command is to be used in the build process of a project, as demonstrated in the example below of a package.json:
This module uses the logging library bunyan. Every log will be represented as a json object. Bunyan besides providing a Logging API, it provides a CLI tool that parses the json and prettifies it. As shown in the code above the developer can pipe the output of the executable to the cli tool -> "npm-dependency-analyzer | bunyan". After making the necessary adjustments to the package.json, the execution of the build script will have the plugin generate a report based on the findings. This report will then be sent to the central system and stored there. Then the report can be accessed through the following link: http://35.234.147.77/