Skip to content

Haroenv/is-dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is-dev

Check if you're on a development version or the live version of your site

Build Status npm version

A tiny script that displays a message if you're on the development version of a site, so you can visually distinguish it from the live version.

Installation

is-dev is on npm, so installing it is as easy as doing:

$ npm install --save is-dev

Usage

Include either is-dev.js via a script tag, or require('is-dev') in your script. After that you can call it like this (all options are optional):

demo and full documentation

isDev({
  dev: [
    '.dev',
    'localhost',
    'file:///'
  ], // parts of the url that can mean you're developing
  message: 'development',
  style: 'top-left',
  // top-left, top-right, bottom, top, none
  custom: 'display: block; background-color: red; font: Comic Sans MS'
  // custom css that extends the style
});

Support

IE9 and up (array.map).

License

Apache 2.0

About

Check if you're on a development version or the live version of your site

Resources

Stars

Watchers

Forks

Packages

No packages published