# yields-store

> minimal store inspired by [component/cookie](https://github.com/component/cookie)

Latest version **1.0.2** (published 2016-02-07) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-02-07 |
| First published | 2016-02-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 67 |
| Author | Amir Abu Shareb |
| Maintainers | pirxpilot |
| Keywords | browser |

## Links

- npm: https://www.npmjs.com/package/yields-store
- Repository: https://github.com/yields/store
- Homepage: https://github.com/yields/store#readme
- Issues: https://github.com/yields/store/issues
- npm.io page: https://npm.io/package/yields-store

## Dependencies (2)

- [component-each](https://npm.io/package/component-each.md) *
- [yields-unserialize](https://npm.io/package/yields-unserialize.md) *

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2016-02-07

## README

# store

  minimal store inspired by [component/cookie](https://github.com/component/cookie)

## Installation

    $ component install yields/store

## Example

```js
store('foo', ['baz']);
store('foo'); // > ['baz']
store({ foo: 'baz' });
store('foo'); // > 'baz'
store('foo', null);
store('foo'); // > null
store('baz', 0);
store(); // > { baz: 0 }
store(null);
store(); // > {}
```

## API

### store(key, val)

set `key` to `val`, the value will be `JSON.stringify()`ied.

### store(obj)

store the given `object`.

### store(key, null)

remove `key`.

### store(key)

get `key` value, it will be unserialized.

### store(null)

invokes `localStorage.clear()`

### store()

get all items, they will be unserialized.

## License

  MIT

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