# store-object

> Creates a simple named store object which serves as a wrapper for an array or an object and provides utilities for adding and retrieving values.

Latest version **0.0.2** (published 2014-10-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install store-object
pnpm add store-object
yarn add store-object
bun add store-object
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2014-10-10 |
| First published | 2014-08-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Chris Webb |
| Maintainers | cwebbdesign |
| Keywords | storage, utility |

## Links

- npm: https://www.npmjs.com/package/store-object
- Repository: git@github.com:cwebbdesign/store-object
- Homepage: https://github.com/cwebbdesign/store-object
- Issues: https://github.com/cwebbdesign/store-object/issues
- npm.io page: https://npm.io/package/store-object

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ~2.4.1

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2014-10-10
- 0.0.1 — 2014-08-21

## README

# Store Object

Creates a simple named store object which serves as a wrapper for an array or an object and provides utilities for adding and retrieving values.

The object store is intended to store objects. Objects are keyed to a name.
The array store is ideal for storing variables, string values or numerical values.


## Installation

    npm install store-object

## Usage

The store can be an array or an object. When the store is an array, any value can be stored in it. 

    var Store = require('store-object'),
    	store = new Store('myStore'); 
   
    // Object
	store = {
		name: 'myStore',
		items: {}
	};
	
	store.populate({
		name: 'thingOne',
		value: 0
	});
	store.add({
	    name:'thingTwo', value:1
	});
	// store.items = {thingOne: {name: 'thingOne', value: 0}, thingTwo: {name: 'thingTwo', value: 0}};
	
	store.get('thingOne');
	// {name: 'thingOne', value:1}
	
	store.remove('thingOne');
	// store.items = {thingTwo: {name: 'thingTwo', value: 1}}; 
	
	// Array
	store = {
		items: [thing, thingTwo]
	};
	
	store.get(thing);
	// [thing]
	
	store.add(anotherThing);
	
	
# Test

	npm install mocha -g
	mocha

---
_Source: https://npm.io/package/store-object · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
