### Install CVSS Library Source: https://github.com/rohitcoder/cvss/blob/main/README.md Installs the cvss4 library using npm for use in Node.js projects. ```Bash npm install --save cvss4 ``` -------------------------------- ### Browser Usage (UMD) Source: https://github.com/rohitcoder/cvss/blob/main/README.md Shows how to integrate the cvss4 library in a web browser using the UMD bundle. ```HTML ``` -------------------------------- ### Node.js Usage (CommonJS) Source: https://github.com/rohitcoder/cvss/blob/main/README.md Demonstrates how to use the cvss4 library in a Node.js environment using CommonJS module syntax. ```JavaScript const cvss = require('cvss4'); console.log(cvss.calculateBaseScore('CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N')); ``` -------------------------------- ### Node.js Usage (ES Modules) Source: https://github.com/rohitcoder/cvss/blob/main/README.md Demonstrates how to use the cvss4 library in a Node.js environment using ES Modules syntax. ```JavaScript import { calculateBaseScore } from 'cvss4'; console.log(calculateBaseScore('CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N')); ``` -------------------------------- ### CVSS Humanization API Source: https://github.com/rohitcoder/cvss/blob/main/README.md Converts abbreviated CVSS metric names and values to their full, human-readable forms. ```APIDOC humanizeBaseMetric(metric: string): string Converts an abbreviated metric name to its full form. Example: ```javascript humanizeBaseMetric('C'); // Returns: 'Confidentiality' ``` humanizeBaseMetricValue(value: string, metric: string): string Converts an abbreviated metric value to its full form. Example: ```javascript humanizeBaseMetricValue('N', 'AV'); // Returns: 'Network' ``` ``` -------------------------------- ### CVSS Score Calculation API Source: https://github.com/rohitcoder/cvss/blob/main/README.md Provides API methods for calculating CVSS Base Scores, Impact Sub-Scores (ISS), Impact, and Exploitability using metric maps. ```APIDOC calculateBaseScore(cvssString): number Computes the Base Score of a CVSS vector string. Example: ```javascript import { calculateBaseScore } from 'cvss4'; console.log(calculateBaseScore('CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N')); ``` calculateIss(metricsMap): number Calculates the Impact Sub-Score (ISS). calculateImpact(metricsMap, iss): number Computes the Impact. calculateExploitability(metricsMap): number Computes the Exploitability. ``` -------------------------------- ### CVSS Validation API Source: https://github.com/rohitcoder/cvss/blob/main/README.md Validates a CVSS vector string. Throws an error if the string is invalid or unsupported. ```APIDOC validate(cvssString): void Validates the CVSS vector string. Throws an error if the string is invalid or unsupported. Example: ```javascript import { validate } from 'cvss4'; validate('CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:N'); ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.