https://github.com/masbicudo/cvss-js
CVSS library for Javascript
https://github.com/masbicudo/cvss-js
cve cvss cvssv2 javascript-library
Last synced: 3 months ago
JSON representation
CVSS library for Javascript
- Host: GitHub
- URL: https://github.com/masbicudo/cvss-js
- Owner: masbicudo
- License: mit
- Created: 2017-12-01T03:39:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-16T00:44:42.000Z (over 7 years ago)
- Last Synced: 2025-01-16T10:17:21.950Z (4 months ago)
- Topics: cve, cvss, cvssv2, javascript-library
- Language: TypeScript
- Size: 21.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CVSS-Js
CVSS library for JavascriptActually it is made using Typescript and then compiled to Javascript.
Only CVSS 2 is supported at this moment.
Example
-------```
var c = CVSS2.parseMetricsString('AV:N/AC:L/Au:N/C:N/I:N/A:C');
var s = c.baseScore();var btc = c.fillParse('E:U/RL:OF/RC:UC'); // best temporal parameters
var bts = c.temporalScore(); // get the best temporal scorevar Au = c.Au; // getting one of the CVSS parameters value (not the string)
```**CVSS 2 class reflection**
These are isolated examples, they don't have meaning... other than to serve as examples.
```
// Getting the names of all temporal parameters
var tPars = CVSS2.getAllParamInfos()
.filter(x => x.group == "Temporal")
.map(x => x.name);// Getting the possible values for each temporal parameter
var tPVals = CVSS2.getAllParamInfos()
.filter(x => x.group == "Temporal")
.map(x => x.values.map(v => v.stringValue));
```License
-------MIT - do whatever you wish, don't blame me... but I'll be glad to help if you have any trouble =D