https://github.com/kevva/w3counter
An API for w3counter.com
https://github.com/kevva/w3counter
browser nodejs os screen-resolution w3counter
Last synced: 3 months ago
JSON representation
An API for w3counter.com
- Host: GitHub
- URL: https://github.com/kevva/w3counter
- Owner: kevva
- License: mit
- Created: 2014-03-27T12:59:44.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-05-31T19:21:00.000Z (almost 8 years ago)
- Last Synced: 2024-12-17T04:03:05.444Z (5 months ago)
- Topics: browser, nodejs, os, screen-resolution, w3counter
- Language: JavaScript
- Homepage:
- Size: 35.2 KB
- Stars: 4
- Watchers: 6
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# w3counter [](https://travis-ci.org/kevva/w3counter)
> An API for w3counter to get the most popular operating systems, screen resolutions and web browsers
## Install
```
$ npm install --save w3counter
```## Usage
```js
const w3counter = require('w3counter');w3counter('browser').then(data => {
console.log(data);
//=> [{item: 'Chrome 34', percent: '20.71%'}, {item: 'Firefox 28', percent: '13.04%'}, ...]
});w3counter('res').then(data => {
console.log(data);
//=> [{item: '1366x768', percent: '20.34%'}, {item: '1280x800', percent: '9.23%'}, ...]
});
```## API
### w3counter(type)
Returns a promise for an array with the ten most popular items from the type you provided from
[w3counter.com](http://www.w3counter.com/globalstats.php).#### type
Type: `string`
What type of items to get. Available types are:
* `browser` — Ten most popular web browsers
* `os` — Ten most popular operating systems
* `res` — Ten most popular screen resolutions## CLI
```
$ npm install --global w3counter
``````
$ w3counter --helpUsage
$ w3counterExamples
$ w3counter browser
$ w3counter os
$ w3counter res
```## License
MIT © [Kevin Mårtensson](https://github.com/kevva)