# is-es2015

> A feature detection to know if current code is compatible with ES2015

Latest version **0.1.6** (published 2020-09-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install is-es2015
pnpm add is-es2015
yarn add is-es2015
bun add is-es2015
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2020-09-18 |
| First published | 2020-09-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Andrea Giammarchi |
| Maintainers | webreflection |
| Keywords | ES2015, ES6, feature, detection |

## Links

- npm: https://www.npmjs.com/package/is-es2015
- Repository: https://github.com/WebReflection/is-es2015
- Homepage: https://github.com/WebReflection/is-es2015#readme
- Issues: https://github.com/WebReflection/is-es2015/issues
- npm.io page: https://npm.io/package/is-es2015

## Recent versions

- 0.1.6 (latest) — 2020-09-18
- 0.1.5 — 2020-09-17
- 0.1.4 — 2020-09-17
- 0.1.3 — 2020-09-17
- 0.1.2 — 2020-09-17
- 0.1.1 — 2020-09-17
- 0.1.0 — 2020-09-17
- 0.0.0 — 2020-09-17

## README

# is-es2015

This module exports, as ESM or CJS, just the following:

```js
/^class\b/.test(class{})
```

The goal of this module is to understand if the current environment is running transpiled code or not.

> ... and why is that relevant?

Because transpiled code can be untrusted due various transpilers out there, meaning some expected feature such as native classes extends, species, etc, might not work as expected.

If this module returns `true`, your code targets at least ES2015, but if it returns `false`, your code is likely running to target IE11 or lower.

```js
import isES2015 from 'is-es2015';

export default isES2015 ?
  class Celebrate {} :
  function PoorThing() {}
;
```

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