# lesca-local-storage

> save data convert to base64 width timestamp

Latest version **2.1.1** (published 2026-05-21) · 0 weekly downloads

## Install

```sh
npm install lesca-local-storage
pnpm add lesca-local-storage
yarn add lesca-local-storage
bun add lesca-local-storage
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2026-05-21 |
| First published | 2021-05-14 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jameshsu1125 |
| Keywords | lesca |

## Links

- npm: https://www.npmjs.com/package/lesca-local-storage
- npm.io page: https://npm.io/package/lesca-local-storage

## Dependencies (1)

- [lesca-atobtoa](https://npm.io/package/lesca-atobtoa.md) ^2.0.0

## Recent versions

- 2.1.1 (latest) — 2026-05-21
- 2.1.0 — 2026-05-13
- 2.0.0 — 2025-08-12
- 1.1.2 — 2023-11-08
- 1.1.1 — 2023-10-24
- 1.1.0 — 2022-07-05
- 1.0.1 — 2022-04-13
- 1.0.0 — 2021-05-14

## README

[![React](https://img.shields.io/badge/-ReactJs-61DAFB?style=for-the-badge&logo=react&logoColor=white)](https://zh-hant.reactjs.org/)
[![React](https://img.shields.io/badge/Less-1d365d?style=for-the-badge&logo=less&logoColor=white)](https://lesscss.org/)
[![React](https://img.shields.io/badge/Typescript-4277c0?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![React](https://img.shields.io/badge/HTML5-E34F26?style=for-the-badge&logo=html5&logoColor=white)](https://www.w3schools.com/html/)
[![React](https://img.shields.io/badge/-CSS3-1572B6?style=for-the-badge&logo=css3&logoColor=white)](https://www.w3schools.com/css/)
[![NPM](https://img.shields.io/badge/NPM-ba443f?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/)
[![React](https://img.shields.io/badge/Node.js-43853D?style=for-the-badge&logo=node.js&logoColor=white)](https://nodejs.org/en/)
[![NPM](https://img.shields.io/badge/DEV-Jameshsu1125-9cf?style=for-the-badge)](https://www.npmjs.com/~jameshsu1125)

# Why use it?

save data by base64 in local storage.

#### [Live Demo](https://jameshsu1125.github.io/lesca-local-storage/)

# Installation

```sh
npm install lesca-local-storage --save
```

## Usage

```javascript
import Storage from 'lesca-local-storage';

// set any type of data
Storage.set('keyName', { anyKey: 'anyValue', name: 'anyName' });

// get data from storage
const { data, timestamp } = Storage.get('keyName');

console.log(data); //{ anyKey: 'anyValue', name: 'anyName' }
console.log(timestamp); // get milliseconds => (set data time ------> now)
```

## Development

### Methods

| method                                        |    description     | return |
| :-------------------------------------------- | :----------------: | -----: |
| .**set**(**key**:_string_, **data**:_object_) | set data as a key  |   void |
| .**get**(**key**:_string_)                    | get data as a key  |   void |
| .**remove**(**key**:_string_)                 | remove data by key |   void |
| .**clear**()                                  |   clear all data   |   void |

### Features

- maintain if necessary

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