Skip to content

spurreiter/cpe-fs

Repository files navigation

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

npm install cpe-fs

usage

generate a CPE from attributes

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

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

About

Common Platform Enumeration Formatted String

Resources

License

Stars

Watchers

Forks

Packages

No packages published