# light-secure-storage

> Lightweight session/local storage encryption.

Latest version **1.0.4** (published 2021-06-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install light-secure-storage
pnpm add light-secure-storage
yarn add light-secure-storage
bun add light-secure-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.4 |
| Published | 2021-06-29 |
| First published | 2021-06-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Grovine |
| Maintainers | grovine |
| Keywords | localStorage, sessionStorage, encryption, crypto-js, secure storage, lightweight |

## Links

- npm: https://www.npmjs.com/package/light-secure-storage
- npm.io page: https://npm.io/package/light-secure-storage

## Dependencies (1)

- [crypto-js](https://npm.io/package/crypto-js.md) ^3.0.0

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2021-06-29
- 1.0.3 — 2021-06-28
- 1.0.2 — 2021-06-28
- 1.0.1 — 2021-06-28
- 1.0.0 — 2021-06-28

## README

# Light secure storage

Light secure storage is a lightweight library designed to keep localStorage/sessionStorage encrypted for security, while still maintaining the same functionality and usage.

## Installation

```bash
npm install light-secure-storage
```

## Usage

It is recommended to use this storage as a singleton, although not required.

### localStorage
```js
import LightSecureStorage from 'light-secure-storage';

const options = { type: 'localStorage' }
const myStorage = new LightSecureStorage('my secret key', options)

myStorage.setItem('some key', 'some value');
console.log(myStorage.getItem('some key')); // prints 'some value'
myStorage.removeItem('some key');
```

### sessionStorage
```js
import LightSecureStorage from 'light-secure-storage';

const options = { type: 'sessionStorage' }
const myStorage = new LightSecureStorage('my secret key', options)

myStorage.setItem('some key', 'some value');
console.log(myStorage.getItem('some key')); // prints 'some value'
myStorage.removeItem('some key');
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


## License
[MIT](https://choosealicense.com/licenses/mit/)

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