# snifferrr

> A browser sniffing util

Latest version **2.0.3** (published 2022-10-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install snifferrr
pnpm add snifferrr
yarn add snifferrr
bun add snifferrr
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2022-10-06 |
| First published | 2022-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 37 |
| Author | Florian Morel |
| Maintainers | jeremymarc |
| Keywords | browser, sniffing, detect, device, os |

## Links

- npm: https://www.npmjs.com/package/snifferrr
- Repository: https://github.com/watsondg/sniffer
- Homepage: https://github.com/watsondg/sniffer#readme
- Issues: https://github.com/watsondg/sniffer/issues
- npm.io page: https://npm.io/package/snifferrr

## Dependencies (1)

- [dashify](https://npm.io/package/dashify.md) ^0.2.2

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 2.0.3 (latest) — 2022-10-06

## README

sniffer.js
===

A browser sniffing util.

## Install

```
npm install watsondg/sniffer -S
```

## Usage

```
var sniffer = require('sniffer');

console.log(sniffer.isDesktop); // true

// If using any app singleton, you can do something like
_.extend(App, sniffer.getInfos());
console.log(App.isDesktop); // true

sniffer.addClasses(document.documentElement);
console.log(document.documentElement.className); // is-desktop
```

## Instance Methods

### addClasses(el)

Add dashed-case sniffing classes to the given element, i.e. `is-ios`, `is-firefox`.
* `el` - the element to add classes to.


### getInfos()

Return an object containing all the sniffing properties.

## Instance Properties

### isEdge
### isIE
### isIE11

### isDroid
### isDroidTablet
### isDroidPhone

### isIos
### isIpad

### isTablet
### isPhone
### isDevice `(isPhone && isTablet)`

### isDesktop
### isFirefox
### isSafari
### isOpera
### isChrome

## License
MIT.

---
_Source: https://npm.io/package/snifferrr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
