# simple-save

> A stupidly simple way to persist data.

Latest version **1.0.2** (published 2015-09-10) · MIT license · 0 weekly downloads

## Install

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

## 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.2 |
| Published | 2015-09-10 |
| First published | 2015-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Avery Morin |
| Maintainers | schmavery |
| Keywords | save, database, persist |

## Links

- npm: https://www.npmjs.com/package/simple-save
- Repository: https://github.com/Schmavery/simple-save
- Issues: https://github.com/Schmavery/simple-save/issues
- npm.io page: https://npm.io/package/simple-save

## Recent versions

- 1.0.2 (latest) — 2015-09-10
- 1.0.1 — 2015-09-10
- 1.0.0 — 2015-09-10

## README

# simple-save
A stupidly simple way of persisting values in nodejs.
This will rewrite tagged literal values that are assigned to variables in your source code.


- No config files!
- No environment variables!
- No databases!

Persist hardcoded data in your source files like you've always wanted!

# Install
```bash
  npm install simple-save
```

# Usage

```js
save(variableName:string, newValue, [suffix:string])
```

Call the package with the name of the variable you want to persist, and the new
value. This will replace the assignments of all tagged occurrences of this
variable with the new value.

```js
  var save = require("simple-save")();
  /*SS*/ var test = 3;

  test = 5
  save("test", test);
```


# Advanced

If you want to set a custom tag instead of the default of `"SS"`, pass in a
string:
```js
  var save = require("simple-save")("SAVE");
```

You can also set custom tag suffixes on a per-variable basis as follows.  In the
following example, only the value of the variable within the function is modified.
```js
  var save = require("simple-save")();
  /*SS*/ var test = 3;

  function ttt(){
    /*SS:1*/ var test = 3;
  }

  test = 5
  save("test", test, "1");
```

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