Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

@jam3/detect

1.0.2 • Public • Published

detect

User Agent refined detect, it's using bowser as a base detector.

Why do we need another detector?

This detector has some important features that we use at Jam3 like Device Orientation, in App Browser Detection, etc.

Installation

npm install @jam3/detect

Importing

import detect from '@jam3/detect';
import {bots, browser} from '@jam3/detect';

Usage

  1. Know the OS Major Version
import {os} from '@jam3/detect';

console.log(os.getOSMajorVersion());
  1. Get device orientation
import {device} from '@jam3/detect';

console.log(device.isPortrait());
console.log(device.isLandscape());

TODO

  1. Unify API, there are some boolean and methods called is[noun], we should have a clear convention between methods and variables.

Install

npm i @jam3/detect

DownloadsWeekly Downloads

156

Version

1.0.2

License

MIT

Unpacked Size

84.2 kB

Total Files

28

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar