List all browsers compat data from MDN and filter with browserlist.

Overview

mdn-compat-browserlist

List all browsers compat data from MDN and filter with browserlist.

Features

Install

npm install mdn-compat-browserlist
yarn add mdn-compat-browserlist

Setup

import { MdnCompat } from "mdn-compat-browserlist";
import bcd from "@mdn/browser-compat-data";

Usage

Init MdnCompat with browserlist query and config (optional).

const compat = new MdnCompat(["> 0.5%", "last 2 versions", "not dead"]);

Unsupport listing

compat.unsupport(bcd.css);
compat.unsupport(bcd.css.properties);
compat.unsupport(bcd.css.properties["justify-content"]);

Results

For listing unsupported features, the browser list in __browsers will contains the max version of the browser which filter by browserlist query.

Normal result sample

must contains __browsers key

'box-shadow': {
  __browsers: {
    chrome: '100',
    chrome_android: '100',
    firefox: '99',
    firefox_android: '99',
    opera_android: '64',
    safari: '15.4',
    safari_ios: '15.4',
    samsunginternet_android: '16.0',
    webview_android: '100'
  }
}
Nested result sample

must NOT contains __browsers key

'justify-content': {
  flex_context: {
    __browsers: { firefox: '99', firefox_android: '99' }
  },
  grid_context: {
    __browsers: { ie: '11' }
  }
}

Alternative CSS properties

compat.alternative(bcd.css.properties);
compat.alternative(bcd.css.properties["justify-content"]);

Results

compat.alternative(bcd.css.properties["font-smooth"]);

// output
["-webkit-font-smoothing", "-moz-osx-font-smoothing"];
compat.alternative(bcd.css.properties["justify-content"]);

// output
{
  flex_context: ["-webkit-justify-content"],
  grid_context: []
}

License

MIT License

CC0-1.0 License for MDN data

You might also like...

A simple Todo App with check complete function and filter todo. Made with React and TypeScript.

A simple Todo App with check complete function and filter todo. Made with React and TypeScript.

A simple Todo App with check complete function and filter todo. Made with React and TypeScript. The app can Add, Delete and Edit todo. Todo can be sorted by Complete or Active.

Dec 6, 2022

Kalman Filter in Javascript

Kalman Kalman filter for Javascript. Dependencies The module requires a sylvester.js (https://github.com/jcoglan/sylvester) compatible matrix and vect

Dec 19, 2022

Filter sale 1K gần bạn

Filter sale 1K gần bạn Tại sao lại có cái này? Đôi khi bạn sẽ nhận được (hoặc săn được) voucher freeship đơn 0đ của shopee (10k hoặc 25k), và phí ship

Nov 25, 2022

Search/Filter beer for beerpong

Search/Filter beer for beerpong

Beer for Beerpong 🍺 You can search beer to play beer pong 🍻 🏓 You sink it, they drink it LINK Technologies 🚀 React React Router Dom Beer Animation

Feb 24, 2022

A javascript plugin to filter elements from a "masonry" grid.

Isolde Isolde is a lightweight, flexible, and responsive javascript plugin allow you to filter elements from a "masonry" grid. Quick start Install Thi

Oct 13, 2022

This is a simple web application of a To-do List in which you can add, remove and edit all your tasks and also you can mark each task as completed and delete all completed ones.

To-Do List A simple web application of a to do list Built With HTML, CSS, JS, ES6 & Webpack Getting Started In this repository I created To-Do List SP

Apr 11, 2022

This "To-do-list" app is a simple web application that displays a list of task and allows you to add and remove task from that list. it is built with the latest technology namely; JavaScript with webpack Configuration.

This

To-do-list "To-do-list" is a simple web application that displays a list of task and allows you to add and remove task from that list. Built With HTML

Nov 21, 2022

This "To-do-list" app is a simple web application that displays a list of task and allows you to add and remove task from that list

This

This "To-do-list" app is a simple web application that displays a list of task and allows you to add and remove task from that list. it is built with the latest technology including but not limited to HTML, CSS, JavaScript and webpack to manipulate DOM.

Feb 19, 2022
Releases(v0.0.5)
Owner
SerKo
A lazy developer coding to be more lazy 😴
SerKo
Obsidian-dataview-table-filter-menu - Dynamically created filter menu for dataview tables in obsidian

Dataview table Filter Menu for Obsidian Dynamically created filter menu for data

shiro 17 Sep 24, 2022
Query for CSS brower support data, combined from caniuse and MDN, including version support started and global support percentages.

css-browser-support Query for CSS browser support data, combined from caniuse and MDN, including version support started and global support percentage

Stephanie Eckles 65 Nov 2, 2022
💻 Countries Web is a web application that lets you view data for all the countries in the world and filter them by country name and continent.

?? Countries Web View Demo This is the Countries Web, a web application that lets you view data for all the countries in the world and filter them by

João Gabriel 5 Jun 23, 2022
Easy view and filter all follows and following. Auto update by GitHub Action.

?? List All Followers And Following Easy view and filter all follows and following. Auto update by GitHub Action. Since GitHub's default follows and f

Yuri 10 Dec 28, 2022
This package generates a unique ID/String for different browsers. Like chrome, Firefox and any other browsers which supports canvas and audio Fingerprinting.

Broprint.js The world's easiest, smallest and powerful visitor identifier for browsers. This package generates a unique ID/String for different browse

Rajesh Royal 68 Dec 25, 2022
Javascript client for Sanity. Works in node.js and modern browsers (older browsers needs a Promise polyfill).

@sanity/client Javascript client for Sanity. Works in node.js and modern browsers (older browsers needs a Promise polyfill). Requirements Sanity Clien

Sanity 23 Nov 29, 2022
jQuery filter for all purposes.

jQuery EasyFilter The easiest way to filter anything! How to use 1. Include jQuery (ignore this if you have already included on the page). <script src

Rafael F. da Silva 2 Jun 17, 2022
jQuery easy ticker is a news ticker like plugin, which scrolls the list infinitely. It is highly customizable, flexible with lot of features and works in all browsers.

jQuery Easy Ticker plugin jQuery easy ticker is a news ticker like plugin which scrolls a list infinitely. It is highly customizable, flexible with lo

Aakash Chakravarthy 208 Dec 20, 2022
History.js gracefully supports the HTML5 History/State APIs (pushState, replaceState, onPopState) in all browsers. Including continued support for data, titles, replaceState

History.js gracefully supports the HTML5 History/State APIs (pushState, replaceState, onPopState) in all browsers. Including continued support for data, titles, replaceState. Supports jQuery, MooTools and Prototype.

Browser State 10.8k Dec 26, 2022
A to-do list set up using webpack. It allows the user to add, remove, edit and check items on the list. All the data is saved in local storage.

Project Name: Webpack-Project: To-Do-List Description of the project: A simple to-do-list app created using webpack. Built With Major languages: HTML

Tracey Kadenyi 7 Aug 5, 2022