https://github.com/spurreiter/cpe-fs
Common Platform Enumeration Formatted String
https://github.com/spurreiter/cpe-fs
Last synced: 3 months ago
JSON representation
Common Platform Enumeration Formatted String
- Host: GitHub
- URL: https://github.com/spurreiter/cpe-fs
- Owner: spurreiter
- License: mit
- Created: 2023-11-22T05:42:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-05T11:55:12.000Z (about 1 year ago)
- Last Synced: 2025-02-08T20:04:32.439Z (3 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cpe-fs
Parses and generates Common Platform Enumeration Identifiers
Supports only formatted strings from [Common Platform Enumeration: Naming Specification Version 2.3][]
Does not use WFN as internal value representation.
# install
```sh
npm install cpe-fs
```# usage
generate a CPE from attributes
```js
import { Cpe } from 'cpe-fs'new Cpe({
vendor: 'microsoft',
product: 'internet explorer',
version: '8.0.6001',
update: 'beta'
}).toString()
//> 'cpe:2.3:a:microsoft:internet_explorer:8.0.6001:beta:*:*:*:*:*:*'
```parse CPE
```js
import { Cpe } from 'cpe-fs'const cpe = new Cpe().parse('cpe:2.3:a:foo\\\\bar:big\\$money_2010:*:*:*:*:special:ipod_touch:80gb:*')
{
part: 'a',
vendor: 'foo\\bar',
product: 'big$money 2010',
version: '*',
update: '*',
edition: '*',
language: '*',
swEdition: 'special',
targetSw: 'ipod touch',
targetHw: '80gb',
other: '*'
}
```# license
[MIT Licensed](./LICENSE)
[Common Platform Enumeration: Naming Specification Version 2.3]: https://csrc.nist.gov/pubs/ir/7695/final