stdprop
Define object properties without boilerplate
Usage
With this modules, you can define object properties using the following shorthand (original longhand included for reference):
var prop = var obj = {} // non-enumerable and non-writable// with stdprop: // previously:Object // enumerable and non-writable// with stdprop: // previously:Object // enumerable and writable// with stdprop: // previously:Object
getters & setters
Also included are two shorthand methods to create getters and setters on any given object.
var getter setter = var interface = {}var storage = {} interfaceshout = 'hello'console // => 'HELLO!'console // => 'HELLO'
Acknowledgement
The idea of using shorthand flags to create property descriptors was taken from the existing module prr.
License
Apache-2.0