Package Exports
- @wessberg/browserslist-generator
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@wessberg/browserslist-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Browserslist Generator
Description
A library that makes it easier to work with browserslists. For example, a browserslist can be generated that targets only browsers that support specific required features. Or, a browserslist can be generated that target only browsers that doesn't support specific features.
Features
matchBrowserslistOnUserAgent (userAgent: string, browserslist: string[]): boolean
Will check if the given user agent string matches the given browserslist and return true if so.
browsersWithSupportForFeatures (...features: string[]): string[]
Takes any amount of caniuse features and generates a browserslist that targets all browsers that support these features
browsersWithoutSupportForFeatures (...features: string[]): string[]
Takes any amount of caniuse features and generates a browserslist that targets all browsers that doesn't support these features
browserslistSupportsFeatures (browserslist: string[], ...features: string[]): boolean
Returns true if the given browserslist supports all of the given features
Installation
npm install @wessberg/browserslist-generator
Usage
import {browsersWithSupportForFeatures} from "@wessberg/browserslist-generator";
// Generate a browserslist for browsers that support all of the given features
const browserslist = browsersWithSupportForFeatures(
"es6-module",
"shadowdomv1",
"custom-elementsv1"
);