Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

browserslist

Package Overview
Dependencies
Maintainers
1
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browserslist

Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset

  • 4.24.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
55M
decreased by-1.62%
Maintainers
1
Weekly downloads
 
Created

What is browserslist?

The browserslist npm package is used to share target browsers and Node.js versions between different front-end tools, like Autoprefixer, Babel, and others. It utilizes a configuration file or package.json entries to specify the range of browser versions that your project supports. It helps in making decisions for transpiling JavaScript, adding vendor prefixes to CSS, and even defining which browser versions to test during the development process.

What are browserslist's main functionalities?

Defining target browsers

This feature allows you to define a range of browsers your project supports by specifying queries like market share, last versions, or excluding certain browsers. The code sample would typically be placed in a package.json file.

"browserslist": ["> 1%", "last 2 versions", "not dead"]

Integration with build tools

Browserslist can be integrated with build tools like Webpack, Babel, or PostCSS to automatically apply browser-specific transformations based on the defined browser support criteria.

const browserslist = require('browserslist');
const supportedBrowsers = browserslist('> 0.5%, last 2 versions, Firefox ESR, not dead');

CLI Usage

Browserslist provides a command-line interface (CLI) that can be used to check which browsers and versions are selected by your queries.

npx browserslist "> 1%, last 2 versions"

Configuring environments

You can define different sets of browsers for various environments, like production or development, within a .browserslistrc file.

[production]
> 1% in US
[development]
last 1 chrome version

Other packages similar to browserslist

Keywords

FAQs

Package last updated on 13 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc