0.2.1 • Published 1 year ago

@stdlib/assert-is-mobile v0.2.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

IS_MOBILE

NPM version Build Status Coverage Status

Check if the current environment is a mobile device.

Installation

npm install @stdlib/assert-is-mobile

Usage

var IS_MOBILE = require( '@stdlib/assert-is-mobile' );

IS_MOBILE

Boolean indicating if the current environment is a mobile device.

var bool = IS_MOBILE;
// returns <boolean>

Notes

  • In order to determine whether the current environment is a mobile device, the implementation checks whether the User Agent contains the string "Mobi" per the MDN recommendations.

Examples

var IS_MOBILE = require( '@stdlib/assert-is-mobile' );

console.log( IS_MOBILE );
// => <boolean>

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2024. The Stdlib Authors.