Socket
Socket
Sign inDemoInstall

browserslist

Package Overview
Dependencies
1
Maintainers
1
Versions
188
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.3.0

3

ChangeLog.md

@@ -0,1 +1,4 @@

## 0.3
* Takes criterias from `BROWSERSLIST` environment variable.
## 0.2

@@ -2,0 +5,0 @@ * Return Can I Use joined versions as `ios_saf 7.0-7.1`.

13

index.js

@@ -29,7 +29,12 @@ var caniuse = require('caniuse-db/data').agents;

if ( typeof(selections) == 'undefined' || selections === null ) {
var config = browserslist.readConfig(opts.path);
if ( config === false ) {
selections = browserslist.defaults;
if ( process.env.BROWSERSLIST ) {
selections = process.env.BROWSERSLIST;
} else {
selections = config;
var config = browserslist.readConfig(opts.path);
if ( config !== false ) {
selections = config;
} else {
selections = browserslist.defaults;
}
}

@@ -36,0 +41,0 @@ }

{
"name": "browserslist",
"version": "0.2.0",
"version": "0.3.0",
"description": "Get browsers versions that matches given criterias like in Autoprefixer",

@@ -13,11 +13,11 @@ "keywords": ["caniuse", "browsers"],

"dependencies": {
"caniuse-db": "^1.0.30000054"
"caniuse-db": "^1.0.30000078"
},
"devDependencies": {
"jshint-stylish": "1.0.0",
"gulp-jshint": "1.9.0",
"gulp-jshint": "1.9.2",
"gulp-mocha": "2.0.0",
"mocha": "2.1.0",
"chai": "1.10.0",
"gulp": "3.8.10"
"chai": "2.0.0",
"gulp": "3.8.11"
},

@@ -24,0 +24,0 @@ "scripts": {

@@ -7,18 +7,20 @@ # Browserslist [![Build Status](https://travis-ci.org/ai/browserslist.svg)](https://travis-ci.org/ai/browserslist)

You can select browsers by passing a string. This library will use Can I Use
data to return the appropriate list of all matching versions.
data to return the appropriate list of all matching versions.
For example, the last version of each major browser and version,
with a usage of over 5% in global usage statistics:
For example, the last version of each major browser and versions,
with a usage of over 5% in global usage statistics:
```js
browserslist('> 5%, last 1 version');
browserslist('last 1 version, > 5%');
//=> ['and_chr 40', 'chrome 40', 'chrome 39', 'firefox 35', 'firefox 34',
// 'ie 11', 'ie_mob 11', 'ios_saf 8.1', 'opera 26', 'safari 8']
// 'ie 11', 'ie_mob 11', 'ios_saf 8.1', 'opera 27', 'safari 8']
```
If you don't provide an argument, Browserslist will look for a `browserslist`
config file in current or parent directories.
Browserslist will use browsers criterias from:
If no config file is found, Browserslist will use the default list:
`> 1%, last 2 versions, Firefox ESR, Opera 12.1`.
1. First argument.
2. `BROWSERSLIST` environment variable.
3. `browserslist` config file in current or parent directories.
4. If all methods will not give a result, Browserslist will use defaults:<br>
`> 1%, last 2 versions, Firefox ESR, Opera 12.1`.

@@ -49,3 +51,3 @@ <a href="https://evilmartians.com/?utm_source=browserslist">

[two-letter country codes]: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
[two-letter country code]: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements

@@ -89,3 +91,3 @@ ## Browsers

Queries can be a string `"> 5%, last 1 version"`
or and array `['> 5%', 'last 1 version']`.
or an array `['> 5%', 'last 1 version']`.

@@ -92,0 +94,0 @@ ## Config File

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc