Skip to content

An implementation of PHP-like define functions for defining constants.

License

Notifications You must be signed in to change notification settings

Buzu/js_constants

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

js_constants

An implementation of PHP-like define functions for defining constants.

How to use it?

Simply add the constants.js file to your project. Then define your constants:

define('IMG_PATH', '/images/');

You can get the value of the Constant by using the get function.

get('IMG_PATH');

If the constant is not defined, you get an error log on the javascript console.

You can also check if a constant has been defined:

defined('IMG_PATH');//returns true

About

An implementation of PHP-like define functions for defining constants.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published