node package manager
Loosely couple your services. Use Orgs to version and reuse your code. Create a free org »

is-heroku

is-heroku Build Status

Check if your code is running on Heroku

Install

$ npm install --save is-heroku

Usage

var isHeroku = require('is-heroku');
 
// on your local computer 
console.log(isHeroku);
//=> false 
 
// on Heroku 
console.log(isHeroku);
//=> true 

Add an environment variable first to improve the detection:

$ heroku config:set HEROKU=1

License

MIT © Sindre Sorhus