# is-ec2

> Test if the current node process is running on AWS EC2

Latest version **1.0.2** (published 2018-03-12) · ISC license · 0 weekly downloads

## Install

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

## 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 | 1.0.2 |
| Published | 2018-03-12 |
| First published | 2016-04-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Von Lehman |
| Maintainers | dvonlehman |
| Keywords | aws, ec2 |

## Links

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

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-03-12
- 1.0.1 — 2017-02-23
- 1.0.0 — 2016-04-25

## README

# is-ec2

Sometimes you need to know if you are running on EC2 or not. This will tell you.

~~~sh
npm install is-ec2
~~~

~~~js
var isec2 = require('is-ec2');

if (isec2()) {
  console.log('yep');
}
~~~

This works by executing the following command:

~~~sh
if [ -f /sys/hypervisor/uuid ]; then echo `head -c 3 /sys/hypervisor/uuid`; fi
~~~

Only work on Linux EC2 instances, not Windows. See this [StackOverflow article](http://serverfault.com/questions/462903/how-to-know-if-a-machine-is-an-ec2-instance) for details.

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