Comparing version 1.1.0 to 2.0.0
12
cli.js
#!/usr/bin/env node | ||
'use strict'; | ||
var meow = require('meow'); | ||
@@ -11,15 +10,10 @@ var getRes = require('./'); | ||
' $ get-res' | ||
].join('\n') | ||
] | ||
}); | ||
getRes(function (err, res) { | ||
if (err) { | ||
console.error(err.message); | ||
process.exit(1); | ||
} | ||
getRes().then(function (res) { | ||
res.forEach(function (r, i) { | ||
i = i + 1; | ||
i++; | ||
console.log(i + '. ' + r.item + ' (' + r.percent + ')'); | ||
}); | ||
}); |
12
index.js
'use strict'; | ||
var w3counter = require('w3counter'); | ||
module.exports = function (cb) { | ||
w3counter('res', function (err, data) { | ||
if (err) { | ||
cb(err); | ||
return; | ||
} | ||
cb(null, data); | ||
}); | ||
module.exports = function () { | ||
return w3counter('res'); | ||
}; |
{ | ||
"name": "get-res", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "Get ten most popular screen resolutions", | ||
@@ -19,3 +19,3 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "node test.js" | ||
"test": "xo && ava" | ||
}, | ||
@@ -32,8 +32,14 @@ "files": [ | ||
"dependencies": { | ||
"meow": "^3.0.0", | ||
"w3counter": "^1.0.3" | ||
"meow": "^3.3.0", | ||
"w3counter": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.0.4" | ||
"ava": "^0.2.0", | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"ignore": [ | ||
"test/test.js" | ||
] | ||
} | ||
} |
@@ -16,8 +16,8 @@ # get-res [![Build Status](http://img.shields.io/travis/kevva/get-res.svg?style=flat)](https://travis-ci.org/kevva/get-res) | ||
```js | ||
var getRes = require('get-res'); | ||
const getRes = require('get-res'); | ||
getRes(function (err, data) { | ||
getRes().then(data => { | ||
console.log(data); | ||
// => [{item: '1366x768', percent: '20.34%'}, {item: '1280x800', percent: '9.23%'}, ...] | ||
}) | ||
}); | ||
``` | ||
@@ -28,17 +28,7 @@ | ||
### getRes(callback) | ||
### getRes() | ||
Gets ten most popular screen resolutions from [w3counter](http://www.w3counter.com/globalstats.php). | ||
Gets ten most popular screen resolutions from [w3counter](http://www.w3counter.com/globalstats.php). Returns a promise that resolves to an array containing the results. | ||
#### callback(err, data) | ||
Type: `function` | ||
##### data | ||
Type: `array` | ||
An array of objects containing the ten most popular resolutions. | ||
## CLI | ||
@@ -45,0 +35,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2994
2
21
49
+ Addedcapture-stack-trace@1.0.2(transitive)
+ Addedcreate-error-class@2.0.1(transitive)
+ Addedgot@4.2.0(transitive)
+ Addedis-plain-obj@1.1.0(transitive)
+ Addednode-status-codes@1.0.0(transitive)
+ Addedpinkie@1.0.0(transitive)
+ Addedpinkie-promise@1.0.0(transitive)
+ Addedunzip-response@1.0.2(transitive)
+ Addedw3counter@2.0.1(transitive)
- Removedgot@3.3.1(transitive)
- Removedinfinity-agent@2.0.3(transitive)
- Removednested-error-stacks@1.0.2(transitive)
- Removedw3counter@1.2.0(transitive)
Updatedmeow@^3.3.0
Updatedw3counter@^2.0.0