A simple container
Install
npm install --save hold-it
Usage
Container
constructor
Parametersdata
Object intialize with this data
add
It won't rewrite if the key already exists, use updateParameters
key
string name of the keyvalue
any anything
- Throws TypeError when property is already present
get
Get value at key propertyParameters
key
string property to getsilent
boolean? whether to throw error if property not defined (optional, defaultfalse
)
- Throws ReferenceError when the silent flag is false and the property is not found
Returns any whatever stored at the key property
set
Will not check if property already exist, will add or set it anywayParameters
key
string name of the keyvalue
any anything
unpack
Unpack, just expose the data object, so that we can use desctructingReturns Object the whole data