Detect if current machine is running on AWS EC2. Inspired by is-ec2, adds theoretical Windows support and does not needlessly spawn a process on Linux.
const isEC2 = require('is-ec2-machine')
if (isEC2()) {
console.log('yep')
} else {
console.log('no')
}
With npm do:
npm install is-ec2-machine
MIT © ironSource