Envs

Environments checks.

Methods

(inner) amdEnv() → {boolean}

Check if AMD environment

Interfaces: not, err

Source:
Returns:
Type:
boolean
Example
be.amdEnv() // true

(inner) android(range, agent) → {boolean}

Check if is Android device

Interfaces: not, err

Source:
Parameters:
Name Type Description
range string

operator and version number "==", "<", "<=", ">", "=>" ex: >=4

agent string

user agent string

Returns:
Type:
boolean
Example
be.android() // true
be.android('==4') // true

(inner) androidPhone(range, agent) → {boolean}

Check if is Android phone

Interfaces: not, err

Since:
  • 1.6.0
Source:
Parameters:
Name Type Description
range string

operator and version number "==", "<", "<=", ">", "=>" ex: >=4

agent string

user agent string

Returns:
Type:
boolean
Example
be.androidPhone() // true

(inner) androidTablet(range, agent) → {boolean}

Check if is Android tablet

Interfaces: not, err

Since:
  • 1.6.0
Source:
Parameters:
Name Type Description
range string

operator and version number "==", "<", "<=", ">", "=>" ex: >=4

agent string

user agent string

Returns:
Type:
boolean
Example
be.androidTablet() // true

(inner) blackberry(agent) → {boolean}

Check if is BlackBerry device

Interfaces: not, err

Since:
  • 1.6.0
Source:
Parameters:
Name Type Description
agent string

user agent string

Returns:
Type:
boolean
Example
be.blackberry() // true

(inner) browserEnv() → {boolean}

Check if browser environment

Interfaces: not, err

Source:
Returns:
Type:
boolean
Example
be.browserEnv() // true

(inner) chrome(range, agent) → {boolean}

Chrome detecting

Interfaces: not, err

Source:
Parameters:
Name Type Description
range string

operator and version number "==", "<", "<=", ">", "=>" ex: >=4

agent string

user agent string

Returns:
Type:
boolean
Example
be.chrome() // true
be.chrome('==59') // true

(inner) chromeIOS(range, agent) → {boolean}

Chrome iOS detecting

Interfaces: not, err

Since:
  • 1.6.0
Source:
Parameters:
Name Type Description
range string

operator and version number "==", "<", "<=", ">", "=>" ex: >=4

agent string

user agent string

Returns:
Type:
boolean
Example
be.chromeIOS() // true
be.chromeIOS('==59') // true

(inner) commonjsEnv() → {boolean}

Check if server environment

Interfaces: not, err

Source:
Returns:
Type:
boolean
Example
be.commonjsEnv() // true

(inner) desktop(agent) → {boolean}

Check if is desktop device

Interfaces: not, err

Since:
  • 1.6.0
Source:
Parameters:
Name Type Description
agent string

user agent string

Returns:
Type:
boolean
Example
be.desktop() // true

(inner) edge(range, agent) → {boolean}

Edge detecting

Interfaces: not, err

Since:
  • 1.6.0
Source:
Parameters:
Name Type Description
range string

operator and version number "==", "<", "<=", ">", "=>" ex: >=4

agent string

user agent string

Returns:
Type:
boolean
Example
be.edge() // true
be.edge('>=12') // true

(inner) firefox(range, agent) → {boolean}

Firefox detecting

Interfaces: not, err

Source:
Parameters:
Name Type Description
range string

operator and version number "==", "<", "<=", ">", "=>" ex: >=4

agent string

user agent string

Returns:
Type:
boolean
Example
be.firefox() // true
be.firefox('==30') // true

(inner) ie(range, agent) → {boolean}

Explorer detecting

Interfaces: not, err

Source:
Parameters:
Name Type Description
range string

operator and version number "==", "<", "<=", ">", "=>" ex: >=4

agent string

user agent string

Returns:
Type:
boolean
Example
be.ie() // true
be.ie('==9') // true

(inner) ios(agent) → {boolean}

Check if is iOS device

Interfaces: not, err

Source:
Parameters:
Name Type Description
agent string

user agent string

Returns:
Type:
boolean
Example
be.ios() // true

(inner) ipad(agent) → {boolean}

Check if is iPad device

Interfaces: not, err

Source:
Parameters:
Name Type Description
agent string

user agent string

Returns:
Type:
boolean
Example
be.ipad() // true

(inner) iphone(agent) → {boolean}

Check if is iPhone device

Interfaces: not, err

Source:
Parameters:
Name Type Description
agent string

user agent string

Returns:
Type:
boolean
Example
be.iphone() // true

(inner) ipod(agent) → {boolean}

Check if is iPod device

Interfaces: not, err

Source:
Parameters:
Name Type Description
agent string

user agent string

Returns:
Type:
boolean
Example
be.ipod() // true

(inner) linux(agent) → {boolean}

Linux detecting

Interfaces: not, err

Since:
  • 1.6.0
Source:
Parameters:
Name Type Description
agent string

user agent string

Returns:
Type:
boolean
Example
be.linux() // true

(inner) mac(agent) → {boolean}

Mac detecting

Interfaces: not, err

Source:
Parameters:
Name Type Description
agent string

user agent string

Returns:
Type:
boolean
Example
be.mac() // true

(inner) mobile(agent) → {boolean}

Check if is mobile device

Interfaces: not, err

Since:
  • 1.6.0
Source:
Parameters:
Name Type Description
agent string

user agent string

Returns:
Type:
boolean
Example
be.mobile() // true

(inner) navigator() → {boolean}

Check if exists navigator object

Interfaces: not, err

Source:
Returns:
Type:
boolean
Example
be.navigator() // true

(inner) online() → {boolean}

Check if is on line

Interfaces: not, err

Source:
Returns:
Type:
boolean
Example
be.onLine() // true

(inner) safari(range, agent) → {boolean}

Safari detecting

Interfaces: not, err

Source:
Parameters:
Name Type Description
range string

operator and version number "==", "<", "<=", ">", "=>" ex: >=4

agent string

user agent string

Returns:
Type:
boolean
Example
be.safari() // true
be.safari('<=7') // true

(inner) safariMobile(range, agent) → {boolean}

Safari mobile detecting

Interfaces: not, err

Since:
  • 1.6.0
Source:
Parameters:
Name Type Description
range string

operator and version number "==", "<", "<=", ">", "=>" ex: >=4

agent string

user agent string

Returns:
Type:
boolean
Example
be.safariMobile() // true
be.safariMobile('<=7') // true

(inner) tablet(agent) → {boolean}

Check if is tablet device

Interfaces: not, err

Since:
  • 1.6.0
Source:
Parameters:
Name Type Description
agent string

user agent string

Returns:
Type:
boolean
Example
be.tablet() // true

(inner) windows(agent) → {boolean}

Windows detecting

Interfaces: not, err

Source:
Parameters:
Name Type Description
agent string

user agent string

Returns:
Type:
boolean
Example
be.windows() // true

(inner) windowsPhone(range, agent) → {boolean}

Check if is Windows Phone

Interfaces: not, err

Since:
  • 1.6.0
Source:
Parameters:
Name Type Description
range string

operator and version number "==", "<", "<=", ">", "=>" ex: >=4

agent string

user agent string

Returns:
Type:
boolean
Example
be.windowsPhone() // true

(inner) windowsTablet(range, agent) → {boolean}

Check if is Windows Tablet

Interfaces: not, err

Since:
  • 1.6.0
Source:
Parameters:
Name Type Description
range string

operator and version number "==", "<", "<=", ">", "=>" ex: >=4

agent string

user agent string

Returns:
Type:
boolean
Example
be.windowsTablet() // true