react-useragent
Advanced tools
Comparing version
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('mobile-detect')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'react', 'mobile-detect'], factory) : | ||
(factory((global.reactUserAgent = {}),global.React,global.mobileDetect)); | ||
(factory((global.ReactUserAgent = {}),global.React,global.MobileDetect)); | ||
}(this, (function (exports,React,MobileDetect) { 'use strict'; | ||
@@ -6,0 +6,0 @@ |
{ | ||
"name": "react-useragent", | ||
"version": "1.1.1", | ||
"version": "1.1.2-alpha", | ||
"description": "Utility to add user agent information to your react components", | ||
"main": "lib/index.js", | ||
"author": "Jon Stuebe", | ||
"homepage": "https://github.com/jonstuebe/react-useragent#readme", | ||
"license": "MIT", | ||
"browser": "lib/reactUserAgent-umd.js", | ||
"main": "lib/reactUserAgent-cjs.js", | ||
"module": "lib/reactUserAgent-es.js", | ||
"jsnext:main": "lib/reactUserAgent-es.js", | ||
"umdName": "ReactUserAgent", | ||
"source": "src/index.js", | ||
"private": false, | ||
"files": [ | ||
"lib/" | ||
], | ||
"scripts": { | ||
"build": "babel --presets es2015,stage-0,react -d lib/ src/", | ||
"prepublish": "npm run build" | ||
"prepublish": "npm run build", | ||
"build": "rollup -c", | ||
"start": "rollup -c -w" | ||
}, | ||
"peerDependencies": { | ||
"react": "^15.5.4" | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/jonstuebe/react-useragent.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/jonstuebe/react-useragent/issues" | ||
}, | ||
"keywords": [ | ||
@@ -24,8 +38,23 @@ "react", | ||
"devDependencies": { | ||
"babel-cli": "^6.24.1", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-core": "^6.26.0", | ||
"babel-eslint": "^8.0.3", | ||
"babel-jest": "^22.1.0", | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-react": "^6.24.1", | ||
"babel-preset-stage-0": "^6.24.1", | ||
"react": "^15.5.4" | ||
"prop-types": "^15.6.0", | ||
"react": "^16.2.0", | ||
"react-dom": "^16.2.0", | ||
"rollup": "^0.52.3", | ||
"rollup-plugin-auto-external": "^1.0.0", | ||
"rollup-plugin-babel": "^3.0.3", | ||
"rollup-plugin-commonjs": "^8.2.6", | ||
"rollup-plugin-node-resolve": "^3.0.0" | ||
}, | ||
"peerDependencies": { | ||
"prop-types": "^15.0.0 || ^16.0.0", | ||
"react": "^15.0.0 || ^16.0.0" | ||
}, | ||
"dependencies": { | ||
@@ -32,0 +61,0 @@ "mobile-detect": "^1.3.6" |
@@ -5,6 +5,34 @@ # React User Agent | ||
npm | ||
```shell | ||
npm i --save react-useragent | ||
``` | ||
or yarn | ||
```shell | ||
yarn add react-useragent | ||
``` | ||
## Importing | ||
### ES6 | ||
```javascript | ||
import { UserAgent } from "react-useragent"; | ||
``` | ||
### ES5 (CommonJS) | ||
```javascript | ||
const { UserAgent } = require("react-useragent"); | ||
``` | ||
### ES5 (UMD Build) | ||
```javascript | ||
var UserAgent = ReactUserAgent.UserAgent; | ||
``` | ||
## Usage | ||
@@ -23,3 +51,3 @@ | ||
{({ ua }) => { | ||
return ua.mobile ? <input type="date" /> : <input type="text">; | ||
return ua.mobile ? <input type="date" /> : <input type="text" />>; | ||
}} | ||
@@ -44,3 +72,3 @@ </UserAgent> | ||
<UserAgent render={({ ua }) => { | ||
return ua.mobile ? <input type="date" /> : <input type="text">; | ||
return ua.mobile ? <input type="date" /> : <input type="text" />>; | ||
}} /> | ||
@@ -47,0 +75,0 @@ </div> |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
1
-50%119
30.77%0
-100%52706
-57%3
50%16
220%6
-25%1274
-0.16%1
Infinity%1
Infinity%