<commit_before># stash

Stash is a Go library providing an in-memory data store, backed by a file on disk. It's designed for simple object storage when you don't need the overhead of a proper database.


Stash instances are safe for concurrent use by multiple goroutines. Data is serialized to disk using `json.Marshal()`, please see [the docs](https://golang.org/pkg/encoding/json/#Marshal) to understand how values are encoded to JSON.

## Installation

```bash
$ go get -u github.com/dmjones500/go-stash/stash
```

## Quick Start

Create a new Stash, which auto-flushes to disk:

```Go
stash, err := stash.NewStash(filename, true)
if err != nil {
    // handle error
}
```

Save a complex structure:

```Go
err = stash.Save("accountData", account)
```

Retrieve it to another variable:

```Go
var anotherAccount Account
err = stash.Read("accountData", &anotherAccount)
```
	
If you don't enable auto-flush, then call `Flush()` when you want to persist all data to disk:

```Go
err = stash.Flush()
```

## License

Stash is licensed under the [MIT License](https://opensource.org/licenses/MIT).<commit_msg>Correct project name<commit_after># go-stash

Go-stash is a Go library providing an in-memory data store, backed by a file on disk. It's designed for simple object storage when you don't need the overhead of a proper database.


Stash instances are safe for concurrent use by multiple goroutines. Data is serialized to disk using `json.Marshal()`, please see [the JSON docs](https://golang.org/pkg/encoding/json/#Marshal) to understand how values are encoded to JSON.

## Installation

```bash
$ go get -u github.com/dmjones500/go-stash/stash
```

## Quick Start

Create a new Stash, which auto-flushes to disk:

```Go
stash, err := stash.NewStash(filename, true)
if err != nil {
    // handle error
}
```

Save a complex structure:

```Go
err = stash.Save("accountData", account)
```

Retrieve it to another variable:

```Go
var anotherAccount Account
err = stash.Read("accountData", &anotherAccount)
```
	
If you don't enable auto-flush, then call `Flush()` when you want to persist all data to disk:

```Go
err = stash.Flush()
```

## License

Go-stash is licensed under the [MIT License](https://opensource.org/licenses/MIT).
{'fraction_non_alphanumeric': 0.11756817165847117, 'fraction_numerical': 0.002682163611980331, 'mean_word_length': 4.315914489311164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2287062', 'n_tokens_mistral': 725, 'n_tokens_neox': 669, 'n_words': 276}