pci-id-parser

1.0.0 • Public • Published

A small library to parse a PCI ID database into a JS Object or find a specific device.

Inspired by pci-ids

Installation

$ npm install pci-id-parser

Available Functions

// Parse text PCI ID database to JS Object 
parse_pci_list({file = "STRING"})


// Find the device using provided information
find_pci_device({ 
    vendor_id : "10DE", 
    device_id : "1E81", 
    subvendor_id : "10DE", 
    subdevice_id : "13A0",
    file : raw_data
})

/* 
{
  vendor: 'NVIDIA Corporation',
  device: 'TU104 [GeForce RTX 2080 SUPER]',
  subdevice: 'UNKNOWN',
  subvendor: 'NVIDIA Corporation'
}
*/

// Find the device using provided information
find_pci_device_via_key({ 
    device_key : "Enum\PCI\VEN_10DE&DEV_1E81&SUBSYS_13A010DE&REV_A1",
    file : raw_data
})

/* 
{
  vendor: 'NVIDIA Corporation',
  device: 'TU104 [GeForce RTX 2080 SUPER]',
  subdevice: 'UNKNOWN',
  subvendor: 'NVIDIA Corporation'
}
*/

Create a Local PCI ID list copy

# Install dependencies (node-fetch)
$ npm install

# Run get-list
$ npm run get-list -- -- --json  # --json (default) / --js / --javascript / --mjs

# The file will be created in the root
# The data can be imported from .js/.mjs as
import pci from 'path_to_file/pci-list.js'

Package Sidebar

Install

npm i pci-id-parser

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

12.5 kB

Total Files

6

Last publish

Collaborators

  • berlyozzy