hold-it

1.0.1 • Public • Published

A simple container

Install

npm install --save hold-it

Usage

Container

constructor

Parameters

  • data Object intialize with this data
add

It won't rewrite if the key already exists, use update

Parameters

  • key string name of the key

  • value any anything

  • Throws TypeError when property is already present

get

Get value at key property

Parameters

  • key string property to get

  • silent boolean? whether to throw error if property not defined (optional, default false)

  • 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

  • key string name of the key
  • value any anything
unpack

Unpack, just expose the data object, so that we can use desctructing

Returns Object the whole data

Readme

Keywords

none

Package Sidebar

Install

npm i hold-it

Weekly Downloads

93

Version

1.0.1

License

MIT

Last publish

Collaborators

  • akshendra