1.0.1 • Published 9 years ago
hold-it v1.0.1
A simple container
Install
npm install --save hold-itUsage
Container
constructor
Parameters
dataObject intialize with this data
add
It won't rewrite if the key already exists, use update
Parameters
keystring name of the keyvalueany anything
- Throws TypeError when property is already present
get
Get value at key property
Parameters
keystring property to getsilentboolean? 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 anyway
Parameters
keystring name of the keyvalueany anything
unpack
Unpack, just expose the data object, so that we can use desctructing
Returns Object the whole data