browserslist 0.3.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ChangeLog.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.4
2
+ * Add `config` option and `BROWSERSLIST_CONFIG` environment variable support.
3
+ * Add symlink config support.
4
+
1
5
  ## 0.3.3
2
6
  * Fix DynJS compatibility (by Nick Howes).
3
7
 
package/README.md CHANGED
@@ -31,7 +31,7 @@ Browserslist will use browsers criterias from:
31
31
 
32
32
  ## Queries
33
33
 
34
- You can specify the browsers by queries (case insensitive):
34
+ You can specify the versions by queries (case insensitive):
35
35
 
36
36
  * `last 2 versions`: the last 2 versions for each major browser.
37
37
  * `last 2 Chrome versions`: the last 2 versions of Chrome browser.
@@ -47,6 +47,9 @@ You can specify the browsers by queries (case insensitive):
47
47
  Blackberry and Android WebView will not be used in `last n versions`.
48
48
  You should add them by name.
49
49
 
50
+ Browserslist works with separated versions of browsers. To use all versions
51
+ of some browsers you can use `Firefox > 0`, but it is a very bad way.
52
+
50
53
  [two-letter country code]: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
51
54
 
52
55
  ## Browsers
@@ -100,3 +103,5 @@ split by a new line. You can write a comment after `#`:
100
103
  Last 2 versions
101
104
  IE 8 # sorry
102
105
  ```
106
+
107
+ You can specify direct path to config by `config` option.
package/index.js CHANGED
@@ -20,6 +20,13 @@ var browserslist = function (selections, opts) {
20
20
 
21
21
  if ( process.env.BROWSERSLIST ) {
22
22
  selections = process.env.BROWSERSLIST;
23
+ } else if ( opts.config || process.env.BROWSERSLIST_CONFIG ) {
24
+ var file = opts.config || process.env.BROWSERSLIST_CONFIG;
25
+ if ( fs.existsSync(file) && fs.statSync(file).isFile() ) {
26
+ selections = browserslist.parseConfig( fs.readFileSync(file) );
27
+ } else {
28
+ throw 'Can\'t read ' + file + ' config';
29
+ }
23
30
  } else {
24
31
  var config = browserslist.readConfig(opts.path);
25
32
  if ( config !== false ) {
@@ -159,7 +166,7 @@ browserslist.readConfig = function (from) {
159
166
  while ( dirs.length ) {
160
167
  config = dirs.concat(['browserslist']).join(path.sep);
161
168
 
162
- if ( fs.existsSync(config) && fs.lstatSync(config).isFile() ) {
169
+ if ( fs.existsSync(config) && fs.statSync(config).isFile() ) {
163
170
  return browserslist.parseConfig( fs.readFileSync(config) );
164
171
  }
165
172
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browserslist",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "description": "Get browsers versions that matches given criterias like in Autoprefixer",
5
5
  "keywords": ["caniuse", "browsers"],
6
6
  "author": "Andrey Sitnik <andrey@sitnik.ru>",
@@ -10,13 +10,13 @@
10
10
  "url": "https://github.com/ai/browserslist.git"
11
11
  },
12
12
  "dependencies": {
13
- "caniuse-db": "^1.0.30000127"
13
+ "caniuse-db": "^1.0.30000153"
14
14
  },
15
15
  "devDependencies": {
16
- "gulp-eslint": "0.9.0",
16
+ "gulp-eslint": "0.11.1",
17
17
  "gulp-mocha": "2.0.1",
18
18
  "mocha": "2.2.4",
19
- "chai": "2.2.0",
19
+ "chai": "2.3.0",
20
20
  "gulp": "3.8.11"
21
21
  },
22
22
  "scripts": {