# check-ie

> Check if user browser is Internet Explorer.

Latest version **2.0.1** (published 2020-05-28) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install check-ie
pnpm add check-ie
yarn add check-ie
bun add check-ie
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2020-05-28 |
| First published | 2018-12-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Linus Willner |
| Maintainers | linuswillner |
| Keywords | internet explorer, ie, browser |

## Links

- npm: https://www.npmjs.com/package/check-ie
- Repository: https://github.com/linuswillner/check-ie
- Homepage: https://github.com/linuswillner/check-ie#readme
- Issues: https://github.com/linuswillner/check-ie/issues
- npm.io page: https://npm.io/package/check-ie

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2020-05-28
- 2.0.0 — 2019-12-26
- 1.0.3 — 2019-12-01
- 1.0.2 — 2019-08-05
- 1.0.1 — 2018-12-27

## README

# check-ie

A lightweight, zero-dependency way to check if a user browser is Internet Explorer.

This module checks if a user browser is Internet Explorer based on the user agent string (In browser context [`window.navigator.userAgent`](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorID/userAgent)).

**Note**: User agents can easily be spoofed. You should always rely on checking for existence of JavaScript features for being completely sure of support for them and the browser being used. See the [MDN disclaimer on user agent string accuracy](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorID/userAgent) for more details.

## Usage

This module is very easy to use. Simply pass in a user agent string and get a result object in return.

```js
const checkIE = require('check-ie')

const ie11 = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko'

checkIE(ie11) // { isIE: true, name: 'Internet Explorer', version: '11.0' }

const firefox = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:64.0) Gecko/20100101 Firefox/64.0'

checkIE(firefox) // { isIE: false, name: '', version: '' }
```

## Options
Per default, this module will check for all Internet Explorer versions including Edge if no options are passed.
```js
checkIE(window.navigator.userAgent)
```

You may restrict what versions are detected like so:
```js
// Note: ie10 includes all versions including 10 and below

const options = {
  ie10: true,
  ie11: true,
  edge: false // Detects Internet Explorer, but not Edge
}

checkIE(window.navigator.userAgent)
```

Omitting a value counts as omission of detection, i.e. omitting `ie10` would be equivalent to setting `ie10` to `false`.

For example, if you only want to detect IE 11 and below, your options setup would look like this:
```js
const options = {
  ie10: true,
  ie11: true
}
```

## License

MIT © Linus Willner and Curtis Fowler.

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