Skip to content

barracuda-cloudgen-access/devices-metadata

Repository files navigation

Devices Metadata

A collection of devices indexed by their identifiers. Currently, we only have Apple hardware in this list.

Usage

Import the getDeviceDataFromIdentifier from @barracuda-cloudgen-access/devices-metadata and use it like so:

const {
  getDeviceDataFromIdentifier,
} = require("@barracuda-cloudgen-access/devices-metadata");

const res = getDeviceDataFromIdentifier("iPad11,2");
console.log(res);

Running the above returns:

$ node script.js
{ name: 'iPad mini (5th gen)',
  category: 'tablet',
  brand: 'apple' }

Build

First, build the docker container locally:

$ docker build -t device-metadata .

Next, run the generation script (needs docker):

$ docker run -v "$PWD":/home/user/app device-metadata node scripts/crawl.js

{
  "i386": {
    "name": "32-bit Simulator",
    "category": "simulator",
    "brand": "apple"
  },
  "x86_64": {
    "name": "64-bit Simulator",
    "category": "simulator",
  ...

The script prints the generated JSON directly to stdout. All logs go to stderr.

Sources

List of sources we use to gather information about hardware models.

Apple hardware

License

This lib is MIT licensed.