Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hden/constant
A constant helper
https://github.com/hden/constant
Last synced: about 1 month ago
JSON representation
A constant helper
- Host: GitHub
- URL: https://github.com/hden/constant
- Owner: hden
- Created: 2013-01-23T02:36:21.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2020-08-16T06:12:40.000Z (over 4 years ago)
- Last Synced: 2024-10-03T12:16:45.256Z (4 months ago)
- Language: CoffeeScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#Constant.coffee
A constant helper using accessor method via Object.definePropertyUsage
----------```coffee-script
k = require '../src/index'k.define 'foo', 'bar'
console.log k.foo
# bark.foo = '' # trying to override foo
console.log k.foo
# bark.define 'foo', '' # trying duplicate declaration of foo
# Throws an errork.throwsError = true
k.foo = '' # Throws an error
```Requirement
----------
[![browser support](http://ci.testling.com/haokang-den/constant.png)](http://ci.testling.com/haokang-den/constant)TO-DO
----------
* Add namespace managementLicence: MIT