Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
duskload committed Jun 14, 2018
0 parents commit e29b0a9
Show file tree
Hide file tree
Showing 12 changed files with 5,991 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["env"],
"plugins": ["transform-object-rest-spread"]
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.idea
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 duskload

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## mobile-device-detect

Helpers for handling mobile devices in javascript.

## Installation

To install, you can use npm or yarn:

```
npm install mobile-device-detect --save
or
yarn add mobile-device-detect
```


### Selectors

| prop | type | description |
| ------------------ | -------- | -------------------------------------------------------------------------------------- |
| isMobile | bool | returns true if device type is `mobile` or `tablet` |
| isMobileOnly | bool | returns true if device type is `mobile` |
| isTablet | bool | returns true if device type is `tablet` |
| isBrowser | bool | returns true if device type is `browser` |
| isSmartTV | bool | returns true if device type is `smarttv` |
| isWearable | bool | returns true if device type is `wearable` |
| isConsole | bool | returns true if device type is `console` |
| isAndroid | bool | returns true if os type is `Android` |
| isWinPhone | bool | returns true if os type is `Windows Phone` |
| isIOS | bool | returns true if os type is `iOS` |
| isChrome | bool | returns true if browser is `Chrome` |
| isFirefox | bool | returns true if browser is `Firefox` |
| isSafari | bool | returns true if browser is `Safari` |
| isOpera | bool | returns true if browser is `Opera` |
| isIE | bool | returns true if browser is `Internet Explorer` |
| isEdge | bool | returns true if browser is `Edge` |
| isChromium | bool | returns true if browser is `Chromium` |
| isMobileSafari | bool | returns true if browser is `Mobile Safari` |
| osVersion | string | returns os version (e.g 7 for `Windows` or 6 for `Android`) |
| osName | string | returns os name (e.g `Windows`, `Android`) |
| fullBrowserVersion | string | returns full browser version (e.g 65.0.3325.181 for `Chrome`) |
| browserVersion | string | returns browser `major` version (e.g 65 in `Chrome` or 9 in `IE`) |
| browserName | string | returns browser name |
| mobileVendor | string | returns mobile device vendor (e.g `LG`, `iPhone` etc) |
| mobileModel | string | returns mobile device model (e.g `Nexus 5`) |
| engineName | string | returns browser engine `name` (e.g `Gecko` for FF or `WebKit` for Chrome) |
| engineVersion | string | returns engine version |
| getUA | string | returns user agent |
| deviceDetect | function | return data object which includes all data about device (e.g version, engine, os etc.) |

## License

MIT
Loading

0 comments on commit e29b0a9

Please sign in to comment.