# chrome-storage

> Helper class for the Chrome Storage API.

Latest version **1.0.3** (published 2016-10-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install chrome-storage
pnpm add chrome-storage
yarn add chrome-storage
bun add chrome-storage
```

## 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.3 |
| Published | 2016-10-22 |
| First published | 2016-10-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Steve Binder |
| Maintainers | stevebinder |
| Keywords | chrome storage, local storage, chrome extension, chrome app, local, sync |

## Links

- npm: https://www.npmjs.com/package/chrome-storage
- Repository: https://github.com/stevebinder/chrome-storage
- Issues: https://github.com/stevebinder/chrome-storage/issues
- npm.io page: https://npm.io/package/chrome-storage

## 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

- 1.0.3 (latest) — 2016-10-22
- 1.0.2 — 2016-10-22
- 1.0.1 — 2016-10-22

## README

# Description
Helper class for the [Chrome Storage API](https://developer.chrome.com/extensions/storage).

# Installation
This package is publicly available through npm ([chrome-storage](http://npmjs.com/chrome-storage)).
Navigate to the root of your project directory and run:
```node
npm install chrome-storage
```

# Usage
```javascript
var Storage = require("./index.js");

// optionally set storage configuration
Storage.configure({
    scope: "sync", // or "local"
});

// load the existing storage into memory
Storage.load(function() {
    // set a storage key
    Storage.set("installtime", Date.now());
    // set storage keys
    Storage.set({
        installtime: Date.now(),
        type: "referral",
    });
    // get a storage key
    Storage.get("installtime", 0); // outputs key's value or 0 if undefined
    // get storage keys
    Storage.get(["installtime", "type"]); // outputs an object of key/values
    // clear some keys from storage
    Storage.remove(["installtime", "otherkey"]);
    // clear all storage
    Storage.clear();
});
```

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