Browser-compat-data: List of all features?

Created on 12 May 2020  路  2Comments  路  Source: mdn/browser-compat-data

Hi! I'm working on a project that provides an embeddable widget for caniuse data, and I'm working on extending it to also include MDN data, e.g. https://caniuse.bitsofco.de/embed/index.html?feat=mdn-api_AbortController

I was wondering if there was one source that lists all the feature identifiers? e.g. a list that would include something like ["api/AbortController", "css/properties/charset"] and so on.

question

Most helpful comment

Thanks for the quick response @Elchi3 ! I will try that approach

This is the project in case you're interested - https://caniuse.bitsofco.de/ !

All 2 comments

Hey, thanks for reaching out! That sounds like a very interesting project. I would like to learn more about it!
If you have the compat data npm package installed, you could then maybe inspect the object tree to see what's exposed?

const bcd = require('mdn-browser-compat-data');
Object.keys(bcd); 
// returns
[
  'api',       'browsers',
  'css',       'html',
  'http',      'javascript',
  'mathml',    'svg',
  'webdriver', 'webextensions',
  'xpath',     'xslt'
]

Object.keys(bcd.api);
// returns
[
  'ANGLE_instanced_arrays',
  'AbortController',
  'AbortPaymentEvent',
  'AbortSignal',
  'AbsoluteOrientationSensor',
  'AbstractRange',
  'AbstractWorker',
  ...
]

If you walk the trees, you can stop at __compat as that's not an feature identifier, but the object actually containing the compat data.

Let me know if this is helpful or if you have any other questions.

Thanks for the quick response @Elchi3 ! I will try that approach

This is the project in case you're interested - https://caniuse.bitsofco.de/ !

Was this page helpful?
0 / 5 - 0 ratings