# share-localstorage

> share localstorage

Latest version **1.1.4** (published 2022-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install share-localstorage
pnpm add share-localstorage
yarn add share-localstorage
bun add share-localstorage
```

## 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.1.4 |
| Published | 2022-02-23 |
| First published | 2021-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 15.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | joe |
| Maintainers | joehecn |
| Keywords | share, localstorage |

## Links

- npm: https://www.npmjs.com/package/share-localstorage
- Repository: https://github.com/joehecn/share-localstorage
- Homepage: https://github.com/joehecn/share-localstorage#readme
- Issues: https://github.com/joehecn/share-localstorage/issues
- npm.io page: https://npm.io/package/share-localstorage

## 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.1.4 (latest) — 2022-02-23
- 1.1.3 — 2022-02-23
- 1.1.2 — 2021-08-25
- 1.1.1 — 2021-08-25
- 1.1.0 — 2021-08-25
- 1.0.9 — 2021-08-25
- 1.0.8 — 2021-08-25
- 1.0.7 — 2021-08-25
- 1.0.6 — 2021-08-24
- 1.0.5 — 2021-08-24
- 1.0.4 — 2021-08-24
- 1.0.3 — 2021-08-24
- 1.0.2 — 2021-08-24
- 1.0.1 — 2021-08-24
- 1.0.0 — 2021-08-24

## README

# share-localstorage

```html
<head>
  <script src="https://cdn.jsdelivr.net/npm/share-localstorage@1.1.3/dist/main.iife.js"></script>
</head>

<body>
  <script>
    console.log(window.shareLocalstorage);
  </script>
</body>
```

```js
import shareLocalstorage from "share-localstorage";

or;

const shareLocalstorage = require("share-localstorage");
```

## Promise method

- init([src? string])
- destory()
- getItem(keyName string)
- setItem(keyName string, keyValue string)
- removeItem(keyName string)

```js
shareLocalstorage
  .init()
  .then(() => {
    return shareLocalstorage.setItem("test5", "test5");
  })
  .then((set) => {
    console.log({ set });
    return shareLocalstorage.getItem("test5");
  })
  .then((get) => {
    console.log({ get });
    return shareLocalstorage.removeItem("test5");
  })
  .then((remove) => {
    console.log({ remove });
    return shareLocalstorage.getItem("test5");
  })
  .then((get) => {
    console.log({ get });
    return shareLocalstorage.destory();
  })
  .catch(console.error);
```

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