# save-local

> Save stuff locally

Latest version **0.2.3** (published 2019-10-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install save-local
pnpm add save-local
yarn add save-local
bun add save-local
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2019-10-07 |
| First published | 2017-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Bu Kinoshita |
| Maintainers | bukinoshita |
| Keywords | save, save-local, store, storage, save-me |

## Links

- npm: https://www.npmjs.com/package/save-local
- Repository: https://github.com/bukinoshita/save-local
- npm.io page: https://npm.io/package/save-local

## Dependencies (2)

- [node-persist](https://npm.io/package/node-persist.md) ^3.0.0
- [caesar-encrypt](https://npm.io/package/caesar-encrypt.md) ^0.0.2

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

- 0.2.3 (latest) — 2019-10-07
- 0.2.2 — 2019-06-07
- 0.2.1 — 2019-06-07
- 0.2.0 — 2017-11-14
- 0.1.0 — 2017-10-10
- 0.0.1 — 2017-08-28

## README

# save-local [![Build Status](https://travis-ci.org/bukinoshita/save-local.svg?branch=master)](https://travis-ci.org/bukinoshita/save-local)

> Save stuff locally


## Install

```bash
$ yarn add save-local
```


## Usage

```js
const SaveLocal = require('save-local')

const saveLocal = new SaveLocal('store')

// you must call saveLocal.init() to initialize the instance
await saveLocal.init()

saveLocal.set({ name: 'token', value: 'my-token' })
saveLocal.get('token').then(value => console.log(value))
// => my-token
```


## API

### SaveLocal(input)

Returns a `constructor`

#### input

Type: `string`<br/>
Required

store name

### methods

#### .init()

Returns a `promise`

Initializes the local store

#### .set([options])

Returns a `promise`

Save and [encrypt](https://github.com/bukinoshita/caesar-encrypt) an item on local store

##### options

Type: `object`<br/>
Required

###### name

Type: `string`<br/>
Required

name of the item to be saved

###### value

Type: `string`<br/>
Required

value of the item to be saved

#### .get(input)

Returns a `promise`

Get and [dencrypt](https://github.com/bukinoshita/caesar-encrypt) an item saved on local store

##### input

Type: `string`<br/>
Required

name of the item saved

#### .remove(input)

Returns a `promise`

Remove an item saved on local store

##### input

Type: `string`<br/>
Required

name of the item saved

#### .list()

Returns a `promise`

Get an array with all `names` and `values`


## Related

- [save-me](https://github.com/bukinoshita/save-me) — CLI for this module
- [git-labels](https://github.com/bukinoshita/git-labels) — Creating Github issue labels
- [git-labels-cli](https://github.com/bukinoshita/git-labels-cli) — Creating Github issue labels CLI


## License

MIT © [Bu Kinoshita](https://bukinoshita.io)

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